Zwiebelchen
You can change this now in User CP.
- Reaction score
- 60
The title says everything: Does this work properly?
In other words: Does the right onDestroy() method fire upon calling the .destroy() command? Can I disguise 'dog' with 'cat'? As far as I know, structs are only integers, so it should work, doesn't it? Which onDestroy() method fires when a 'cat' struct is destroyed by CatOrDog.destroy()?
JASS:
struct cat
integer a
unit b
...
method onDestroy takes nothing returns nothing
call KillUnit(.b)
set .b = null
endmethod
endstruct
struct dog
real c
timer d
...
method onDestroy takes nothing returns nothing
call DestroyTimer(.d)
set .d = null
endmethod
endstruct
function TestFunc takes nothing returns nothing
local dog CatOrDog
if GetRandomInt(1,2) == 1 then
set CatOrDog = dog.create()
else
set CatOrDog = cat.create()
endif
call CatOrDog.destroy()
endfunction
In other words: Does the right onDestroy() method fire upon calling the .destroy() command? Can I disguise 'dog' with 'cat'? As far as I know, structs are only integers, so it should work, doesn't it? Which onDestroy() method fires when a 'cat' struct is destroyed by CatOrDog.destroy()?