- Joined
- Aug 18, 2009
- Messages
- 4,097
The selection for units you have control of and units you do not have control of is different. Now I found that if you have a unit selected, change its owner and you do not have control of that player's units, the unit is deselected. However, although it would not have to be, that deselection is delayed and worse, it does not trigger deselection events.
Therefore, to detect it, you would have to wrap the SetUnitOwner-function, check the current selection state and the alliance setting for ALLIANCE_SHARED_CONTROL of the target player towards the local player. SetUnitOwner is aborted btw if source and target player are the same.
Therefore, to detect it, you would have to wrap the SetUnitOwner-function, check the current selection state and the alliance setting for ALLIANCE_SHARED_CONTROL of the target player towards the local player. SetUnitOwner is aborted btw if source and target player are the same.