diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 063356a1c..b63bb81fc 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -2000,8 +2000,8 @@ void GameObject::TickCapturePoint() // search for players in radius std::list capturingPlayers; - MaNGOS::AnyPlayerInObjectRangeWithOutdoorPvPCheck u_check(this, radius); - MaNGOS::PlayerListSearcher checker(capturingPlayers, u_check); + MaNGOS::AnyPlayerInCapturePointRange u_check(this, radius); + MaNGOS::PlayerListSearcher checker(capturingPlayers, u_check); Cell::VisitWorldObjects(this, checker, radius); GuidSet tempUsers(m_UniqueUsers); diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h index b0ec917d5..c86d6e72f 100644 --- a/src/game/GridNotifiers.h +++ b/src/game/GridNotifiers.h @@ -1174,15 +1174,15 @@ namespace MaNGOS uint32 i_spellId; }; - class AnyPlayerInObjectRangeWithOutdoorPvPCheck + class AnyPlayerInCapturePointRange { public: - AnyPlayerInObjectRangeWithOutdoorPvPCheck(WorldObject const* obj, float range) + AnyPlayerInCapturePointRange(WorldObject const* obj, float range) : i_obj(obj), i_range(range) {} WorldObject const& GetFocusObject() const { return *i_obj; } bool operator()(Player* u) { - return u->CanUseOutdoorCapturePoint() && + return u->CanUseCapturePoint() && i_obj->IsWithinDistInMap(u, i_range); } private: diff --git a/src/game/OutdoorPvP/OutdoorPvP.cpp b/src/game/OutdoorPvP/OutdoorPvP.cpp index 146894c05..8fb94606e 100644 --- a/src/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/game/OutdoorPvP/OutdoorPvP.cpp @@ -95,14 +95,14 @@ void OutdoorPvP::HandlePlayerKill(Player* killer, Player* victim) // creature kills must be notified, even if not inside objective / not outdoor pvp active // player kills only count if active and inside objective - if (groupMember->CanUseOutdoorCapturePoint()) + if (groupMember->CanUseCapturePoint()) HandlePlayerKillInsideArea(groupMember); } } else { // creature kills must be notified, even if not inside objective / not outdoor pvp active - if (killer && killer->CanUseOutdoorCapturePoint()) + if (killer && killer->CanUseCapturePoint()) HandlePlayerKillInsideArea(killer); } } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 767f5ce53..2b9cd34bb 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -6756,9 +6756,11 @@ void Player::UpdateArea(uint32 newArea) UpdateAreaDependentAuras(); } -bool Player::CanUseOutdoorCapturePoint() +bool Player::CanUseCapturePoint() { - return CanUseCapturePoint() && + return isAlive() && // living + !HasStealthAura() && // not stealthed + !HasInvisibilityAura() && // visible (IsPvP() || sWorld.IsPvPRealm()) && !HasMovementFlag(MOVEFLAG_FLYING) && !IsTaxiFlying() && @@ -21340,13 +21342,6 @@ bool Player::CanUseBattleGroundObject() !HasAura(SPELL_RECENTLY_DROPPED_FLAG, EFFECT_INDEX_0)); } -bool Player::CanUseCapturePoint() -{ - return (isAlive() && // living - !HasStealthAura() && // not stealthed - !HasInvisibilityAura()); // visible -} - uint32 Player::GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, uint32 newskintone) { uint32 level = getLevel(); diff --git a/src/game/Player.h b/src/game/Player.h index 806cde679..4625923ed 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2174,15 +2174,10 @@ class MANGOS_DLL_SPEC Player : public Unit bool GetBGAccessByLevel(BattleGroundTypeId bgTypeId) const; bool CanUseBattleGroundObject(); bool isTotalImmune(); + + // returns true if the player is in active state for capture point capturing bool CanUseCapturePoint(); - /*********************************************************/ - /*** OUTDOOR PVP SYSTEM ***/ - /*********************************************************/ - - // returns true if the player is in active state for outdoor pvp objective capturing - bool CanUseOutdoorCapturePoint(); - /*********************************************************/ /*** REST SYSTEM ***/ /*********************************************************/ diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 855b55d3b..e78c09c00 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12156" + #define REVISION_NR "12157" #endif // __REVISION_NR_H__