- Joined
- Oct 11, 2012
- Messages
- 711
Hi, I have two questions:
First, does this leak?
Second, how should I use local trigger? Does it leak? Should I remove use TriggerRemoveAction? I noticed this issue or issues when I found a post on thehelper website, which was posted by PurgeandFire six years ago.. LOL
First, does this leak?
JASS:
function Trig_jiance takes nothing returns nothing
local unit triggeru = udg_Hero[(1+GetPlayerId(GetTriggerPlayer()))]
local real x = GetUnitX(triggeru)
local real y = GetUnitY(triggeru)
local integer i = 0
local string msgx = R2S(x)
local string msgy = R2S(y)
loop
call DisplayTimedTextToPlayer(Player(i),0,0,15,"X:"+msgx)
call DisplayTimedTextToPlayer(Player(i),0,0,15,"Y:"+msgy)
set i = i + 1
exitwhen i == 7
endloop
set triggeru = null
endfunction
function InitTrig_jiance takes nothing returns nothing
local integer index
local trigger t = CreateTrigger()
set index = 0
loop
call TriggerRegisterPlayerChatEvent(t, Player(index), "-xy", true)
set index = index + 1
exitwhen index == 7
endloop
call TriggerAddAction( t, function Trig_jiance)
set t = null
endfunction
Second, how should I use local trigger? Does it leak? Should I remove use TriggerRemoveAction? I noticed this issue or issues when I found a post on thehelper website, which was posted by PurgeandFire six years ago.. LOL