- Joined
- Nov 22, 2006
- Messages
- 1,260
I figured out that I don't understand completely how loops work. I saw this code:
Which was supposed to register the event for players 0-11, but doesn't this loop end when integer "i" reaches 11? Meaning, won't the loop now register the event only for players 0-10? The loop checks exitwhen always at the beginning of the loop, right? Would it make any difference if I put the exitwhen somewhere else?
Good I'm embarassed.......
JASS:
loop
exitwhen i == 11
call TriggerRegisterPlayerEvent(gg_trg_AI, Player(i), EVENT_PLAYER_LEAVE)
set i = i + 1
endloop
Which was supposed to register the event for players 0-11, but doesn't this loop end when integer "i" reaches 11? Meaning, won't the loop now register the event only for players 0-10? The loop checks exitwhen always at the beginning of the loop, right? Would it make any difference if I put the exitwhen somewhere else?
Good I'm embarassed.......