Core/Unit: cleanup UnitState enum
Port From (https://github.com/TrinityCore/TrinityCore/commit/1f0dc07ef183eefab5ad2c4a4f857d5184f5ad6f)
This commit is contained in:
@@ -456,7 +456,6 @@ namespace Framework.Constants
|
|||||||
Possessed = 0x10000,
|
Possessed = 0x10000,
|
||||||
Charging = 0x20000,
|
Charging = 0x20000,
|
||||||
Jumping = 0x40000,
|
Jumping = 0x40000,
|
||||||
//Onvehicle = 0x80000,
|
|
||||||
Move = 0x100000,
|
Move = 0x100000,
|
||||||
Rotating = 0x200000,
|
Rotating = 0x200000,
|
||||||
Evade = 0x400000,
|
Evade = 0x400000,
|
||||||
@@ -472,17 +471,18 @@ namespace Framework.Constants
|
|||||||
| Possessed | Charging | Jumping | Move | Rotating
|
| Possessed | Charging | Jumping | Move | Rotating
|
||||||
| Evade | RoamingMove | ConfusedMove | FleeingMove
|
| Evade | RoamingMove | ConfusedMove | FleeingMove
|
||||||
| ChaseMove | FollowMove | IgnorePathfinding,
|
| ChaseMove | FollowMove | IgnorePathfinding,
|
||||||
|
|
||||||
Unattackable = InFlight,
|
Unattackable = InFlight,
|
||||||
// For Real Move Using Movegen Check And Stop (Except Unstoppable Flight)
|
|
||||||
Moving = RoamingMove | ConfusedMove | FleeingMove | ChaseMove | FollowMove,
|
Moving = RoamingMove | ConfusedMove | FleeingMove | ChaseMove | FollowMove,
|
||||||
Controlled = (Confused | Stunned | Fleeing),
|
Controlled = (Confused | Stunned | Fleeing),
|
||||||
LostControl = (Controlled | Jumping | Charging),
|
LostControl = (Controlled | Jumping | Charging),
|
||||||
Sightless = (LostControl | Evade),
|
Sightless = (LostControl | Evade),
|
||||||
CannotAutoattack = (LostControl | Casting),
|
CannotAutoattack = (LostControl | Casting),
|
||||||
CannotTurn = (LostControl | Rotating),
|
CannotTurn = (LostControl | Rotating),
|
||||||
// Stay By Different Reasons
|
|
||||||
NotMove = Root | Stunned | Died | Distracted,
|
NotMove = Root | Stunned | Died | Distracted,
|
||||||
AllState = 0xffffffff //(Stopped | Moving | In_Combat | In_Flight)
|
|
||||||
|
AllErasable = AllStateSupported & ~IgnorePathfinding,
|
||||||
|
AllState = 0xffffffff
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum UnitMoveType
|
public enum UnitMoveType
|
||||||
|
|||||||
@@ -1570,7 +1570,7 @@ namespace Game.Entities
|
|||||||
SetCannotReachTarget(false);
|
SetCannotReachTarget(false);
|
||||||
UpdateMovementFlags();
|
UpdateMovementFlags();
|
||||||
|
|
||||||
ClearUnitState(UnitState.AllState & ~UnitState.IgnorePathfinding);
|
ClearUnitState(UnitState.AllErasable);
|
||||||
|
|
||||||
if (!IsPet())
|
if (!IsPet())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ namespace Game.AI
|
|||||||
skipToHome = false;
|
skipToHome = false;
|
||||||
arrived = false;
|
arrived = false;
|
||||||
|
|
||||||
owner.ClearUnitState(UnitState.AllState & ~(UnitState.Evade | UnitState.IgnorePathfinding));
|
owner.ClearUnitState(UnitState.AllErasable & ~UnitState.Evade);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override MovementGeneratorType GetMovementGeneratorType()
|
public override MovementGeneratorType GetMovementGeneratorType()
|
||||||
|
|||||||
@@ -4383,7 +4383,7 @@ namespace Game.Spells
|
|||||||
pet.SetDynamicFlags(UnitDynFlags.HideModel);
|
pet.SetDynamicFlags(UnitDynFlags.HideModel);
|
||||||
pet.RemoveUnitFlag(UnitFlags.Skinnable);
|
pet.RemoveUnitFlag(UnitFlags.Skinnable);
|
||||||
pet.SetDeathState(DeathState.Alive);
|
pet.SetDeathState(DeathState.Alive);
|
||||||
pet.ClearUnitState(UnitState.AllState);
|
pet.ClearUnitState(UnitState.AllErasable);
|
||||||
pet.SetHealth(pet.CountPctFromMaxHealth(damage));
|
pet.SetHealth(pet.CountPctFromMaxHealth(damage));
|
||||||
|
|
||||||
pet.InitializeAI();
|
pet.InitializeAI();
|
||||||
|
|||||||
Reference in New Issue
Block a user