JASS:
function Trig_Spawn_Basic_Func001Func001C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetEnumUnit()) == 039;h001039; ) ) then
return false
endif
return true
endfunction
function Trig_Spawn_Basic_Func001A takes nothing returns nothing
local location A = GetUnitLoc(GetEnumUnit())
if ( Trig_Spawn_Basic_Func001Func001C() ) then
if ( ( GetPlayerState(GetOwningPlayer(GetEnumUnit()), PLAYER_STATE_RESOURCE_FOOD_USED) < 70 ) ) then
call CreateNUnitsAtLocFacingLocBJ( 5, 039;h00C039;, GetOwningPlayer(GetEnumUnit()), A, A )
endif
else
endif
call RemoveLocation (A)
endfunction
function Trig_Spawn_Basic_Actions takes nothing returns nothing
local group u = GetUnitsInRectAll(GetPlayableMapRect())
call ForGroup( u, function Trig_Spawn_Basic_Func001A )
call DestroyGroup(u)
set u = null
endfunction
//===========================================================================
function InitTrig_Spawn_Basic takes nothing returns nothing
set gg_trg_Spawn_Basic = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Spawn_Basic, 2.00 )
call TriggerAddAction( gg_trg_Spawn_Basic, function Trig_Spawn_Basic_Actions )
endfunction
will it leak?
what's the difference between nullifying and removing/destroying a variable?
does GetEnumUnit leak when i call it?