Skip Remaining Actions not working while in a Player or Unit Group loop

bugbear

New Member
Reaction score
3
After hours of large headaches with a piece of my code, i finally came to the conclusion (supported with some thorough testing) that the "skip remaining actions" function does not work properly when used with a player group loop or unit group loop, but does in a for loop. Any idea why this is?
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
After hours of large headaches with a piece of my code, i finally came to the conclusion (supported with some thorough testing) that the "skip remaining actions" function does not work properly when used with a player group loop or unit group loop, but does in a for loop. Any idea why this is?

player group and unit group loops in jass require another function. For every unit in the group, the function is *basically* called with the unit.

Skip Remaining Actions translates to return. returning means to return a value to the calling function (in this case, nothing) and go to the end of the function. However, because unit/player group loops are seperate function, running a Skip Remaining Actions inside it will cause it only to skip the actions of the unit.

In a For (Integer ...) ... loop, there is no function that is called.

Easiest way to *skip remaining actions* would probably be to set a boolean to true, and have an if-then-else check to see if the boolean is true when the loop is finished. If it is, Skip Remaining Actions.
 

bugbear

New Member
Reaction score
3
Ya, the bool with the if statement trick is what I had to end up doing. Thank you for your explanation; that's what i assumed, but its nice to hear it as a fact.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top