Array manipulation functions

Couldn't find a place to add bug report from here... so here it goes...

array_push skips 0 values, where as setarray() does not

I tested with the following script

Code:
prontera,154,170,4    script    TEST    98,{
    
    setarray(.@one, 0, 1, 2, 3);

    dispbottom(getarraysize(.@one)); // 4

    for(.@i = 0; .@i < getarraysize(.@one); .@i++) {
        dispbottom(.@one[.@i]); // Displays 0,1,2,3
        array_push(.@two, .@i); // Pushes 0,1,2,3 to array .@two
    }

    dispbottom(getarraysize(.@two)); // 3

    for(.@i = 0; .@i < getarraysize(.@two); .@i++) {
        dispbottom(.@two[.@i]); // Displays 1,2,3 // Skips 0
    }

}

 
Great stuff Meko. I remembered this thread from ages ago. Finally found good use for these functions, they are making life a lot easier.

 
Nice stuff just when I need it for scripting.

but this makes one wonder why hercules has so much hidden treasure???

 
Nice stuff just when I need it for scripting.

but this makes one wonder why hercules has so much hidden treasure???
yeah im always using these too. idk, guess it's the way the forums are formatted doesn't allow for legacy posts to feature heavily.

 
One of the useful release i have ever seen! Is this included in Global Functions? If not, I'm wondering why!

 
Back
Top