Core/Unit: cleanup UnitState enum

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