BlueSin
New Member
- Reaction score
- 37
I have a nested loop here:
...that is called at map initialization. Though I think board is never incremented, because only the actions of the first are performed. I probably just made a stupid mistake since I'm not used to doing these things without a for-loop.
Can anyone help?
Code:
function Trig_New_Puzzle_Actions takes nothing returns nothing
local integer puzzle = GetRandomInt(1,3)
local integer board=0
local integer row=0
loop
set board=board+1
exitwhen board>12
loop
set row=row+1
exitwhen row>9
call SetAnswers(udg_Puzzle[row+18*(puzzle-1)],board,row)
call SetHints(udg_Puzzle[row+9*(puzzle-1)],board,row)
endloop
endloop
endfunction
//===========================================================================
function InitTrig_New_Puzzle takes nothing returns nothing
set gg_trg_New_Puzzle = CreateTrigger( )
call TriggerAddAction( gg_trg_New_Puzzle, function Trig_New_Puzzle_Actions )
endfunction
...that is called at map initialization. Though I think board is never incremented, because only the actions of the first are performed. I probably just made a stupid mistake since I'm not used to doing these things without a for-loop.
Can anyone help?