Function CountUnitsInGroup
| 4912 | function CountUnitsInGroup takes group g returns integer |
| 4913 | // If the user wants the group destroyed, remember that fact and clear
|
| 4914 | // the flag, in case it is used again in the callback.
|
| 4915 | local boolean wantDestroy = bj_wantDestroyGroup |
| 4916 | set bj_wantDestroyGroup = false |
| 4917 | |
| 4918 | set bj_groupCountUnits = 0 |
| 4919 | call ForGroup(g, function CountUnitsInGroupEnum) |
| 4920 | |
| 4921 | // If the user wants the group destroyed, do so now.
|
| 4922 | if (wantDestroy) then |
| 4923 | call DestroyGroup(g) |
| 4924 | endif
|
| 4925 | return bj_groupCountUnits |
| 4926 | endfunction
|