Vexorian
Why no custom sig?
- Reaction score
- 187
Yes, structs are much faster than gamecache.
Yes, structs are much Safer than gamecache
Yes, structs are a little less dynamic than gamecache.
Yes, structs are easier to use than gamecache.
Yes, to be used effectively you need a hacked WE.
http://www.wc3campaigns.net/showthread.php?t=88142
Yes, structs are much Safer than gamecache
Yes, structs are a little less dynamic than gamecache.
Yes, structs are easier to use than gamecache.
Yes, to be used effectively you need a hacked WE.
Code:
struct unitdata
integer kool =0
real test = 0.0
endstruct
function WhenAunitiscreated takes unit u returns nothing
local unitdata k=unitdata.create()
call SetUnitUserData(u,k)
endfunction
function unitSetKool takes unit u, integer newkool returns nothing
local unitdata k=GetUnitUserData(u)
set k.kool = newkool
endfunction
function unitremoveKool takes unit u returns nothing
local unitdata k=GetUnitUserData(u)
call UnitRemoveAbility( u, k.kool)
endfunction
function beforetheunitdies takes unit u returns nothing
local unitdata k=GetUnitUserData(u)
//deallocate the instance, there is a limit of 8190 instances per struct type.
call k.destroy()
endfunction
http://www.wc3campaigns.net/showthread.php?t=88142