diff --git a/Source/Game/Chat/Commands/SpellCommands.cs b/Source/Game/Chat/Commands/SpellCommands.cs index 971626b43..6f8772bc4 100644 --- a/Source/Game/Chat/Commands/SpellCommands.cs +++ b/Source/Game/Chat/Commands/SpellCommands.cs @@ -166,7 +166,7 @@ namespace Game.Chat // the max level of the new profession. ushort max = maxPureSkill != 0 ? maxPureSkill : targetHasSkill ? target.GetPureMaxSkillValue((SkillType)skill) : (ushort)level; - if (level == 0 || level > max || max <= 0) + if (level == 0 || level > max) return false; // If the player has the skill, we get the current skill step. If they don't have the skill, we diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index f8d5b2f4c..12c0a9462 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -1740,7 +1740,7 @@ namespace Game.Entities if (!_IsTargetAcceptable(who)) return false; - if (!force && (IsNeutralToAll() || !IsWithinDistInMap(who, GetAttackDistance(who) + m_CombatDistance))) + if (IsNeutralToAll() || !IsWithinDistInMap(who, GetAttackDistance(who) + m_CombatDistance)) return false; } diff --git a/Source/Game/Entities/Object/WorldObject.cs b/Source/Game/Entities/Object/WorldObject.cs index 28b511441..8a805aa08 100644 --- a/Source/Game/Entities/Object/WorldObject.cs +++ b/Source/Game/Entities/Object/WorldObject.cs @@ -2638,7 +2638,7 @@ namespace Game.Entities // can't assist player out of sanctuary from sanctuary if has pvp enabled if (unitTarget.IsPvP()) - if (unit != null && unit.IsInSanctuary() && !unitTarget.IsInSanctuary()) + if (unit.IsInSanctuary() && !unitTarget.IsInSanctuary()) return false; } } diff --git a/Source/Game/Entities/Player/Player.Combat.cs b/Source/Game/Entities/Player/Player.Combat.cs index 8963cdc2e..7a3096a10 100644 --- a/Source/Game/Entities/Player/Player.Combat.cs +++ b/Source/Game/Entities/Player/Player.Combat.cs @@ -619,7 +619,7 @@ namespace Game.Entities if (pvpInfo.EndTimer == 0 || (currTime < pvpInfo.EndTimer + 300) || pvpInfo.IsHostile) return; - if (pvpInfo.EndTimer != 0 && pvpInfo.EndTimer <= currTime) + if (pvpInfo.EndTimer <= currTime) { pvpInfo.EndTimer = 0; RemovePlayerFlag(PlayerFlags.PVPTimer); diff --git a/Source/Game/Entities/Unit/Unit.Pets.cs b/Source/Game/Entities/Unit/Unit.Pets.cs index 9393c1ebb..96c9acdd4 100644 --- a/Source/Game/Entities/Unit/Unit.Pets.cs +++ b/Source/Game/Entities/Unit/Unit.Pets.cs @@ -443,7 +443,7 @@ namespace Game.Entities CharmType type; if (HasUnitState(UnitState.Possessed)) type = CharmType.Possess; - else if (charmer && charmer.IsOnVehicle(this)) + else if (charmer.IsOnVehicle(this)) type = CharmType.Vehicle; else type = CharmType.Charm; diff --git a/Source/Game/Handlers/MiscHandler.cs b/Source/Game/Handlers/MiscHandler.cs index f7d5ceddc..30c536c3d 100644 --- a/Source/Game/Handlers/MiscHandler.cs +++ b/Source/Game/Handlers/MiscHandler.cs @@ -645,7 +645,7 @@ namespace Game if (!groupGuy) continue; - if (!groupGuy.IsInMap(groupGuy)) + if (!groupGuy.IsInWorld) return; if (groupGuy.GetMap().IsNonRaidDungeon()) @@ -725,7 +725,7 @@ namespace Game if (!groupGuy) continue; - if (!groupGuy.IsInMap(groupGuy)) + if (!groupGuy.IsInWorld) return; if (groupGuy.GetMap().IsRaid())