Issue Information
-
#000032
-
5 - Critical
-
Fixed
Issue Confirmations
-
Yes (0)No (0)


Crash: Land Protector With Higher Skill Level
Posted by Hercules Bot on 10 September 2007 - 11:07 AM
Originally posted by theultramage
http://www.eathena.w...cker&showbug=32
(Originally reported here)
All skill units have/get a skill layout (a number that indexes a layout table).
The first MAX_SQUARE_LAYOUT (value: 5) entries are reserved for predefined square layouts of increasing radius.
The point is, only these few are defined, so anything attempting to do a larger area effect will go out of safe array bounds.
Now, land protector's definition looks like this
What does this mean? That when you do @useskill Landprotector 100, the server crashes trying to deploy the skill using a layout that consists of random values.
Note: NJ_SUITON and any other skill that defines its layout this way is affected by this same problem.
jAthena doesn't have to deal with this since their 'guessing' code just takes the current max. value.
How to fix? Well, one way is to define the sequence so that the value stops at 5 and stays there.
It's also possible to add a second pass over all skill unit entries that fixes all invalid ones.
EDIT:
Or verify if the value is valid each time it is retrieved from the array. This seems to be the least complex solution.
This post has been edited by theultramage: Sep 10 2007, 05:22 AM
http://www.eathena.w...cker&showbug=32
(Originally reported here)
All skill units have/get a skill layout (a number that indexes a layout table).
The first MAX_SQUARE_LAYOUT (value: 5) entries are reserved for predefined square layouts of increasing radius.
The point is, only these few are defined, so anything attempting to do a larger area effect will go out of safe array bounds.
Now, land protector's definition looks like this
CODE
3:3:4:4:5
which the auto-guessing code extends by 5,6,6,7,7,..., up to MAX_SKILL_LEVEL.What does this mean? That when you do @useskill Landprotector 100, the server crashes trying to deploy the skill using a layout that consists of random values.
Note: NJ_SUITON and any other skill that defines its layout this way is affected by this same problem.
jAthena doesn't have to deal with this since their 'guessing' code just takes the current max. value.
How to fix? Well, one way is to define the sequence so that the value stops at 5 and stays there.
It's also possible to add a second pass over all skill unit entries that fixes all invalid ones.
EDIT:
Or verify if the value is valid each time it is retrieved from the array. This seems to be the least complex solution.
This post has been edited by theultramage: Sep 10 2007, 05:22 AM