From e81b1e3ba7fc8b896b8d496acb670d682f2962a6 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 6 May 2020 14:46:11 -0400 Subject: [PATCH] Core/Unit: cleanup UnitState enum Port From (https://github.com/TrinityCore/TrinityCore/commit/1f0dc07ef183eefab5ad2c4a4f857d5184f5ad6f) --- Source/Framework/Constants/UnitConst.cs | 8 ++++---- Source/Game/Entities/Creature/Creature.cs | 2 +- Source/Game/Movement/Generators/HomeMovement.cs | 2 +- Source/Game/Spells/SpellEffects.cs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Framework/Constants/UnitConst.cs b/Source/Framework/Constants/UnitConst.cs index eef49aa2f..fa5b7c38c 100644 --- a/Source/Framework/Constants/UnitConst.cs +++ b/Source/Framework/Constants/UnitConst.cs @@ -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 diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index 8fe635ccf..202d07733 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -1570,7 +1570,7 @@ namespace Game.Entities SetCannotReachTarget(false); UpdateMovementFlags(); - ClearUnitState(UnitState.AllState & ~UnitState.IgnorePathfinding); + ClearUnitState(UnitState.AllErasable); if (!IsPet()) { diff --git a/Source/Game/Movement/Generators/HomeMovement.cs b/Source/Game/Movement/Generators/HomeMovement.cs index 1d8089374..985a14843 100644 --- a/Source/Game/Movement/Generators/HomeMovement.cs +++ b/Source/Game/Movement/Generators/HomeMovement.cs @@ -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() diff --git a/Source/Game/Spells/SpellEffects.cs b/Source/Game/Spells/SpellEffects.cs index fad5af7a8..3d8c48039 100644 --- a/Source/Game/Spells/SpellEffects.cs +++ b/Source/Game/Spells/SpellEffects.cs @@ -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();