diff --git a/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs b/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs index 3063e70ad..acac8c12a 100644 --- a/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs +++ b/Source/Game/AI/ScriptedAI/ScriptedEscortAI.cs @@ -376,15 +376,11 @@ namespace Game.AI public void Start(bool isActiveAttacker = true, bool run = false, ObjectGuid playerGUID = default, Quest quest = null, bool instantRespawn = false, bool canLoopPath = false, bool resetWaypoints = true) { // Queue respawn from the point it starts - Map map = me.GetMap(); - if (map != null) + CreatureData cdata = me.GetCreatureData(); + if (cdata != null) { - CreatureData cdata = me.GetCreatureData(); - if (cdata != null) - { - if (WorldConfig.GetBoolValue(WorldCfg.RespawnDynamicEscortNpc) && cdata.spawnGroupData.flags.HasFlag(SpawnGroupFlags.EscortQuestNpc)) - me.SaveRespawnTime(me.GetRespawnDelay()); - } + if (WorldConfig.GetBoolValue(WorldCfg.RespawnDynamicEscortNpc) && cdata.spawnGroupData.flags.HasFlag(SpawnGroupFlags.EscortQuestNpc)) + me.SaveRespawnTime(me.GetRespawnDelay()); } if (me.IsEngaged()) diff --git a/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs b/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs index cf7e0ec19..7d543444a 100644 --- a/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs +++ b/Source/Game/AI/ScriptedAI/ScriptedFollowerAI.cs @@ -180,15 +180,11 @@ namespace Game.AI public void StartFollow(Player player, uint factionForFollower = 0, Quest quest = null) { - Map map = me.GetMap(); - if (map != null) + CreatureData cdata = me.GetCreatureData(); + if (cdata != null) { - CreatureData cdata = me.GetCreatureData(); - if (cdata != null) - { - if (WorldConfig.GetBoolValue(WorldCfg.RespawnDynamicEscortNpc) && cdata.spawnGroupData.flags.HasFlag(SpawnGroupFlags.EscortQuestNpc)) - me.SaveRespawnTime(me.GetRespawnDelay()); - } + if (WorldConfig.GetBoolValue(WorldCfg.RespawnDynamicEscortNpc) && cdata.spawnGroupData.flags.HasFlag(SpawnGroupFlags.EscortQuestNpc)) + me.SaveRespawnTime(me.GetRespawnDelay()); } if (me.IsEngaged()) diff --git a/Source/Game/Entities/GameObject/GameObject.cs b/Source/Game/Entities/GameObject/GameObject.cs index 93a4830af..9ceaff7a2 100644 --- a/Source/Game/Entities/GameObject/GameObject.cs +++ b/Source/Game/Entities/GameObject/GameObject.cs @@ -665,8 +665,7 @@ namespace Game.Entities Unit target; // @todo this hack with search required until GO casting not implemented - Unit owner = GetOwner(); - if (owner) + if (GetOwner() != null) { // Hunter trap: Search units which are unfriendly to the trap's owner var checker = new NearestAttackableNoTotemUnitInObjectRangeCheck(this, radius); diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index 5b4f56526..44c42a978 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -1506,12 +1506,8 @@ namespace Game.Spells { case SpellTargetObjectTypes.Unit: case SpellTargetObjectTypes.UnitAndDest: - if (!m_spellInfo.HasAttribute(SpellAttr2.CanTargetDead)) - { - retMask &= GridMapTypeMask.Player | GridMapTypeMask.Creature; - break; - } - goto case SpellTargetObjectTypes.Corpse; + retMask &= GridMapTypeMask.Player | GridMapTypeMask.Creature; + break; case SpellTargetObjectTypes.Corpse: case SpellTargetObjectTypes.CorpseEnemy: case SpellTargetObjectTypes.CorpseAlly: