- Joined
- Mar 16, 2008
- Messages
- 941
Yes I know that I2H was unsave, but that doesn't matter because it got removed in the last patch (half, the rest will come).
I just thought about this, didn't test it (spelling mistakes) but it should work, could someone need it?
I don't know, since hashtables allow to store units directly, I2H seems to be unimportant, but I was bored 
Ideas?
EDIT: Maybe usefull with TimerUtils, since they only allow to store integers... who knows^^
I just thought about this, didn't test it (spelling mistakes) but it should work, could someone need it?
JASS:
library Integer2Handle initializer Init
globals
private hashtable hash = InitHashtable()
endglobals
function Integer2Handle takes integer i returns handle
return LoadUnitHandle(hash, i, 0)
endfunction
private function SaveUnit takes nothing returns nothing
call SaveUnitHandle(hash, GetHandleId(GetTriggerUnit()), 0, GetTriggerUnit())
endfunction
private function ReturnTrue takes nothing returns boolean
return true
endfunction
private function Init takes nothing returns nothing
local trigger t = CreateTrigger()
local region r = CreateReagion()
call RegionAddRect(r, bj_mapInitialPlayableArea)
call TriggerRegisterEnterRegion(t, r, Condition(function ReturnTrue))
call TriggerAddCondition(t, Condition(SaveUnit))
endfunction
endlibrary
Ideas?
EDIT: Maybe usefull with TimerUtils, since they only allow to store integers... who knows^^