- Joined
- Jun 30, 2006
- Messages
- 230
If I understand the memory leaks correctly, the following code would not leak:
But this would, because of the timer, not because of the Group:
Am I correct?
JASS:
function Trig_SG takes nothing returns nothing
call SetPlayerStateBJ( GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD, 900 )
endfunction
function Trig_SG_Actions takes nothing returns nothing
call ForForce( GetPlayersAll(), function Trig_SG )
endfunction
//===========================================================================
function InitTrig_Starting_Gold takes nothing returns nothing
set gg_trg_Starting_Gold = CreateTrigger( )
call TriggerAddAction( gg_trg_Starting_Gold, function Trig_SG_Actions )
endfunction
JASS:
function Trig_Gold_Over_Time takes nothing returns nothing
call AdjustPlayerStateBJ( 25, GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD )
endfunction
function Trig_Gold_Over_Time_Actions takes nothing returns nothing
call ForForce( GetPlayersAll(), function Trig_Gold_Over_Time )
endfunction
//===========================================================================
function InitTrig_Gold_Over_Time takes nothing returns nothing
set gg_trg_Gold_Over_Time = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Gold_Over_Time, 30.00 )
call TriggerAddAction( gg_trg_Gold_Over_Time, function Trig_Gold_Over_Time_Actions )
endfunction