SetUnitOwner
- Parameters
whichUnit unitUnit to modify.
whichPlayer playerThe unit's new owner.
changeColor booleanTrue to update unit's tinting color to new owner's color, false to leave old color.
- comment
Changes ownership of a unit.
- note
New color is only applied if the unit really changed ownership from one player to another.
- note
Reforged: The HP bar will always have the color of its owner player, regardless of
changeColor.- note
See:
GetOwningPlayer,Player,SetUnitColor,BlzSetSpecialEffectColorByPlayer.- patch
1.00
- Source
- common.j (suggest an edit or discuss on Github)
- return type
nothing- Source code
native SetUnitOwner takes unit whichUnit, player whichPlayer, boolean changeColor returns nothing