> issuing 'impulse 40' repeatedly until:
>
> You are now level 34!
> Crusader gained a level
> You are now level 35!
> Crusader gained a level
>
> switching to "Necromancer" using 'impulse 173':
>
> OP_FETCH_GBL_F -16850(?) -16371(?)
> -16370(?)
> stats.hc : drop_level
> impulse.hc : ImpulseCommands
> weapons.hc : W_WeaponFrame
> client.hc : PlayerPostThink
> stats.hc : drop_level
> array index out of bounds: 53
> Host_Error: Program error
> Sending clc_disconnect
> Client TurkeyStuffer removed
I see that the problem is not with the impulse 40
itself, but is with cahnging class after exceeding
the level limit of 10: If you impulse 40 until lvl
11, you respawn as lvl 9, if you cheat until lv.16
then you respawn as lv.2, ugh...
The problem is in drop_level() in stats.hc where it
doesn't check against the array boundary when it is
calculating the array index for ExperienceValues[]
ie. somethig like the following should fix it:
This must be a problem with the hexenc code. Will look into.
Can you please attach a save so I can reproduce this more easily, some save at a point where issuing the impulse would immediately give the error?
> issuing 'impulse 40' repeatedly until:
>
> You are now level 34!
> Crusader gained a level
> You are now level 35!
> Crusader gained a level
>
> switching to "Necromancer" using 'impulse 173':
>
> OP_FETCH_GBL_F -16850(?) -16371(?)
> -16370(?)
> stats.hc : drop_level
> impulse.hc : ImpulseCommands
> weapons.hc : W_WeaponFrame
> client.hc : PlayerPostThink
> stats.hc : drop_level
> array index out of bounds: 53
> Host_Error: Program error
> Sending clc_disconnect
> Client TurkeyStuffer removed
I see that the problem is not with the impulse 40
itself, but is with cahnging class after exceeding
the level limit of 10: If you impulse 40 until lvl
11, you respawn as lvl 9, if you cheat until lv.16
then you respawn as lv.2, ugh...
The problem is in drop_level() in stats.hc where it
doesn't check against the array boundary when it is
calculating the array index for ExperienceValues[]
ie. somethig like the following should fix it:
diff -u -p -r1.3 stats.hc
--- stats.hc 7 Feb 2007 16:57:10 -0000 1.3
+++ stats.hc 2 Nov 2010 09:06:08 -0000
@@ -512,6 +512,9 @@ float pos;
{
loser.level-=number;
pos = (loser.playerclass - 1) * (MAX_LEVELS+1);
+ if (loser.level > MAX_LEVELS)
+ loser.experience = ExperienceValues[pos+ MAX_LEVELS - 2];
+ else
loser.experience = ExperienceValues[pos+loser.level - 2];
}
else