GetTriggerUnit-
DogEntrepreneur
- Reaction score
- 129
Here's the same code with comments:
JASS:
function func takes nothing returns nothing
local group g=CreateGroup() // Create a group..
local unit u=null // A unit variable to store the FirstOfGroup..
loop // Loop until group is emtpy..
set u=FirstOfGroup(g) // Local variable u set to first unit of the group..
exitwhen u==null // If the variable u is null which means the group is emtpy, exit the loop..
call DoSomething(u) // Do something..
call GroupRemoveUnit(g,u) // Remove unit from group so that it ain't taken anymore..
endloop // Endloop..
call DestroyGroup(g) // Destroy group..
set g=null // Null the group variable..
endfunction