- Joined
- Oct 11, 2012
- Messages
- 711
Hi all, I am learning vJass. Is the following struct correct? It does work in game, but how about leak and other things? It drops certain items when a unit is killed.
JASS:
struct ArenaItem extends array
private static integer i = 0
private static integer array itemmm
private static method itemmsettings takes nothing returns nothing
set itemmm[0] = 'ratc'
set itemmm[1] = 'rat9'
set itemmm[2] = 'belv'
endmethod
private static method run takes nothing returns boolean
local unit dying = GetDyingUnit()
local real x = GetUnitX(dying)
local real y = GetUnitY(dying)
if
/* Code */
endif
set dying = null
return false
endmethod
private static method onInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(t, Condition(function thistype.run))
set t = null
call thistype.itemmsettings()
endmethod
endstruct