| 04-25-2009, 03:14 PM | #1 |
Can someone tell my why this: JASS:private function StopAggression takes unit u returns nothing local integer i = 0 call SyncSelections() loop exitwhen i>bj_MAX_PLAYERS call GroupEnumUnitsSelected(tempG,Player(i),BOOLEXPR_TRUE) set i = i+1 endloop call BJDebugMsg(I2S(CountUnitsInGroup(tempG))) endfunction returns 0, whereas that: JASS:private function StopAggression takes unit u returns nothing local integer i = 0 loop exitwhen i>bj_MAX_PLAYERS call GroupAddGroup(GetUnitsSelectedAll(Player(i)),tempG) set i = i+1 endloop call BJDebugMsg(I2S(CountUnitsInGroup(tempG))) endfunction |
| 04-25-2009, 05:52 PM | #2 |
Because you have this in the first one?: JASS:
call SyncSelections()
|
| 04-25-2009, 06:09 PM | #3 |
EDIT: OK, scrap that all... If you call GroupEnum[...] on a group it is cleared. |
| 04-25-2009, 06:20 PM | #4 |
So does player 12 have something selected? Because all you're doing right now is getting units selected by player 12 in the first example... |
