Viikuna
No Marlo no game.
- Reaction score
- 265
I was working with a little script and Im having problems to think any good and simple way to avoid an endless loop with custom events.
Code:
The problem is that when I use DoStuff in trigger which has StuffEvent there will be an endless loop. Is there any simple way to make that DoStuff loop to ignore that trigger from which the triggering DoStuff was called...?
Code:
JASS:
library StuffLib
globals
private trigger array Trigs
private integer Total=0
endglobals
function TriggerRegisterStuffEvent takes trigger t returns nothing
set Trigs[Total]=t
set Total=Total+1
endfunction
function DoStuff takes stuff returns nothing
local integer i=0
// stuff
loop
exitwhen i>=Total
if IsTriggerEnabled(Trigs<i>) and TriggerEvaluate(Trigs<i>) then
call TriggerExecute(Trigs<i>)
endif
set i=i+1
endloop
endfunction
endlibrary</i></i></i>
The problem is that when I use DoStuff in trigger which has StuffEvent there will be an endless loop. Is there any simple way to make that DoStuff loop to ignore that trigger from which the triggering DoStuff was called...?