Troll-Brain
You can change this now in User CP.
- Reaction score
- 85
Because of this bug it isn't so easy.
Better ideas ?
PS : I don't want to store a boolean manually for each unitid possible on the map
EDIT : It seems that IssueBuildOrderById() always returns true while the arguments are "valids" (existent unit and order).
I mean it returns true for any existent order, "move" for example ...
JASS:
library IsUnitIdValid
globals
private unit U
endglobals
function IsUnitIdValid takes integer i returns boolean
if IsGameLoaded() then // ofc i plan to store the result, to avoid the creation of the unit all the time, when it was already checked
// but i'm waiting for hashtables available on the official patch
set U = CreateUnit(Player(0),i,0.,0.,0.) // yeah i should use a dummy player and constants reals X/Y instead
if GetWidgetLife(U) != 0 then
call RemoveUnit(U)
return true
else
return false
endif
else
return UnitId2String(i) != null
endif
endfunction
endlibrary
Better ideas ?
PS : I don't want to store a boolean manually for each unitid possible on the map
EDIT : It seems that IssueBuildOrderById() always returns true while the arguments are "valids" (existent unit and order).
I mean it returns true for any existent order, "move" for example ...