- Joined
- Mar 29, 2016
- Messages
- 688
Ok, I just realized there is a terrible bug with the RegisterPlayerUnitEvent and RegisterPlayerEvent. A single trigger for both 'certain' playerunit event and 'any' playerunit event won't work as intended because for example:
1 trigger is shared for Players 1, 2, & 3 therefore, whenever a unit is selected from either of the three players, the trigger will run for all of them.
The same goes for specific playerevents. So we still need 1 trigger for each player for the specific player events and 1 shared trigger for the generic player event.
JASS:
call RegisterPlayerUnitEventForPlayer(Player(0), function Func, EVENT_PLAYER_UNIT_SELECTED)
call RegisterPlayerUnitEventForPlayer(Player(1), function Func, EVENT_PLAYER_UNIT_SELECTED)
call RegisterPlayerUnitEventForPlayer(Player(2), function Func, EVENT_PLAYER_UNIT_SELECTED)
The same goes for specific playerevents. So we still need 1 trigger for each player for the specific player events and 1 shared trigger for the generic player event.