Issue information

Issue ID
#32
Status
Fixed
Severity
Critical
Started
Hercules Elf Bot
Sep 10, 2007 11:07
Last Post
Hercules Elf Bot
Mar 5, 2012 16:27
Confirmation
N/A

Hercules Elf Bot - Sep 10, 2007 11:07

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&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