• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

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