Core/Movement: Use SetWalk(true/false) instead of AddUnit/RemoveUnit.
This commit is contained in:
1 parent
9219625243
commit
1cac01b3df
50 files changed
+131
-122
No files matched your search
@@ -9906,7 +9906,7 @@ void Unit::SetCharm(Unit* charm, bool apply)
|
||||
|
||||
if (charm->HasUnitMovementFlag(MOVEMENTFLAG_WALKING))
|
||||
{
|
||||
charm->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
charm->SetWalk(false);
|
||||
charm->SendMovementFlagUpdate();
|
||||
}
|
||||
|
||||
@@ -17455,3 +17455,11 @@ void Unit::SetFacingToObject(WorldObject* pObject)
|
||||
// TODO: figure out under what conditions creature will move towards object instead of facing it where it currently is.
|
||||
SetFacingTo(GetAngle(pObject));
|
||||
}
|
||||
|
||||
void Unit::SetWalk(bool enable)
|
||||
{
|
||||
if (enable)
|
||||
AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
else
|
||||
RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
|
||||
}
|
||||
Reference in new issue
Block a user