- Joined
- Jul 20, 2009
- Messages
- 835
JASS:
library HandleCounting
globals
private hashtable H = InitHashtable()
endglobals
private function I2A takes integer whichInteger returns agent
call SaveFogStateHandle(H,0,0,ConvertFogState(whichInteger))
return LoadAgentHandle(H,0,0)
endfunction
function GetHandleCount takes nothing returns integer
local location maxHandleIndicator = Location(0.,0.)
local integer maxHandleId = GetHandleId(maxHandleIndicator)
local integer countCorrector = 0x100059
call RemoveLocation(maxHandleIndicator)
loop
exitwhen countCorrector > maxHandleId
if I2A(countCorrector) == null then
set maxHandleId = maxHandleId - 1
endif
set countCorrector = countCorrector + 1
endloop
set maxHandleIndicator = null
return maxHandleId-0x100059
endfunction
endlibrary
This thing must give accurate number of handles.
Thanks Geries and Magtheridon96 for the tips
Last edited by a moderator: