i have a function that checks an array of struct-instances if the value of an instance is 0 (yes, the value of the instance itself, not of a member). The purpose of that function is to find free indexes in that array. But after i allocated the instances within that array i'm not able to reset the instances values to 0 - destroying the instance doesn't reset it. Is there a way to 'unallocate' it?
For better understanding below the code:
Thanks for any answers.
whisp
For better understanding below the code:
JASS:
private static method get_free_index takes nothing returns integer
local integer i
set i = 0
loop
exitwhen i == s_traveler.sTravelers.size
if s_traveler.sTravelers[i] == 0 then
return i
endif
set i = i + 1
endloop
return 999999 //no free index in sTravelers sized array
endmethod
Thanks for any answers.
whisp