• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

ChangeOwner deselection

Status
Not open for further replies.
Level 26
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.
 
Status
Not open for further replies.
Top