- Joined
- Apr 27, 2008
- Messages
- 2,455
I want to edit my thread, and that sounds a really silly test but i just want to be sure that trying to store null in an hashtable/gamecache doesn't flush the previous content.
So anyone willing to test it ?
JASS:
scope Test initializer init
globals
private gamecache Gc = InitGameCache("whatever")
private hashtable Ht = InitHashtable()
endglobals
private function init takes nothing returns nothing
local unit u = CreateUnit(Player(0),'hpea',0,0,0)
call BJDebugMsg(I2S(GetHandleId(u)))
call StoreUnit(Gc,"0","0",u)
call StoreUnit(Gc,"0","0",null)
call SaveUnitHandle(Ht,0,0,u)
call SaveUnitHandle(Ht,0,0,null)
set u = RestoreUnit(Gc,"0","0")
call BJDebugMsg("gamecache : "+I2S(GetHandleId(u)))
set u = null
set u = LoadUnitHandle(Ht,0,0)
call BJDebugMsg("hashtable : "+I2S(GetHandleId(u)))
endfunction
endscope
So anyone willing to test it ?