Menu

#25 impulse 40 cheat issue

SVN
open
nobody
gameplay (11)
5
2013-04-08
2010-11-01
No

When the player level exceeds 34, an attempt in switching player class results in a disconnect ('array index out of bounds: 64').

Discussion

  • Ozkan Sezer

    Ozkan Sezer - 2010-11-01

    This must be a problem with the hexenc code. Will look into.

     
  • Ozkan Sezer

    Ozkan Sezer - 2010-11-01

    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?

     
  • Ozkan Sezer

    Ozkan Sezer - 2010-11-02

    > 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

     

Log in to post a comment.