Hatebreeder
So many apples
- Reaction score
- 381
Sooo, I have started to programm again, and I've run into Problems...
So, it gives me "Undefined type UserData. But, shouldn't it be of the typ "UnitData" ? Kinda confused here :x
And this is what I use it for later on. It's a timed Stun function, that adds up the stun duration instead of replacing the stun duration with a longer one.
JASS:
globals
private UnitData array UserData
endglobals
So, it gives me "Undefined type UserData. But, shouldn't it be of the typ "UnitData" ? Kinda confused here :x
JASS:
private struct UnitData
unit Target
real Timeout
static method Timer takes nothing returns boolean
local UnitData this = TT_GetData()
set .Timeout = .Timeout - TT_PERIOD
if .Timeout <= 0 then
call RemoveStun(.Target)
call .destroy()
return true
endif
return false
endmethod
static method create takes unit U, real T returns UnitData
local UnitData this = UnitData.allocate()
set .Target = U
set .Timeout = T
call AddStun(.Target)
set UserData[GetUnitIndex(.Target)] = this
call TT_Start(function UnitData.Timer,this)
return this
endmethod
endstruct
And this is what I use it for later on. It's a timed Stun function, that adds up the stun duration instead of replacing the stun duration with a longer one.