Issue information

Issue ID
#864
Status
Fixed
Severity
Low
Started
Hercules Elf Bot
Jan 23, 2008 22:46
Last Post
Hercules Elf Bot
Jan 23, 2008 22:46
Confirmation
N/A

Hercules Elf Bot - Jan 23, 2008 22:46

Originally posted by [b]~AnnieRuru~[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=864

eAthena script array can support up to 127 indexes (128 elements)

CODE
prontera,164,186,5    script    cleararray    100,{
    input .@max;
    for ( set .@i,0; .@i < .@max; set .@i, .@i + 1 )
        set .@array[.@i], .@i;
    for ( set .@i,0; .@i < getarraysize(.@array); set .@i, .@i + 1 )
        mes .@array[.@i];
    next;
    cleararray .@array[0], 0, 128; // clear entire array
    for ( set .@i,0; .@i < getarraysize(.@array); set .@i, .@i + 1 )
        mes .@array[.@i];
    close;
}
when I entered 128 into input box,
before next it shows 128 lines from 0~127
after next button I expect it don't show any lines because the array should be cleared
but in reality it shows 128 lines 0,0,0,0,0 ... and the last is 127

QUOTE(eAthena\src\map\script.c)
BUILDIN_FUNC(cleararray)
.....
end = start + script_lastdata(st) - 2;
if( end > 127 )
end = 127;
LOL ....
it can clear 127 elements but not 127 indexes ...


apparently this was a copy paste bug ?
QUOTE(eAthena\src\map\script.c)
BUILDIN_FUNC(setarray)
.....
end = start + script_lastdata(st) - 2;
if( end > 127 )
end = 127;
its true that setarray has to stop at 127,
but cleararray should stop at 128 to clear up everything


This post has been edited by ~AnnieRuru~: Jan 23 2008, 02:50 PM