diff options
| author | Shocker <shocker@freakz.ro> | 2011-06-18 14:08:51 +0300 |
|---|---|---|
| committer | Shocker <shocker@freakz.ro> | 2011-06-18 14:08:51 +0300 |
| commit | 7f0af21fcd0d9d69e61390db58ff517356c8cf34 (patch) | |
| tree | bc3b4bcfcf6ac80b5f92acd93d12287f6c36fe44 /src | |
| parent | 06690cb4b871d5043423f438cd1a11f332f9157b (diff) | |
Revert "Core/Battlegrounds: Remove player on leave from battleground player map only after battleground-specific code"
Some battlegrounds (arenas) need access to the updated player map in RemovePlayer(), pass team as parameter instead
Diffstat (limited to 'src')
28 files changed, 39 insertions, 40 deletions
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 133749fedd5..3b96b842ff7 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -873,6 +873,16 @@ void Battleground::BlockMovement(Player* plr) void Battleground::RemovePlayerAtLeave(const uint64& guid, bool Transport, bool SendPacket) { uint32 team = GetPlayerTeam(guid); + bool participant = false; + // Remove from lists/maps + BattlegroundPlayerMap::iterator itr = m_Players.find(guid); + if (itr != m_Players.end()) + { + UpdatePlayersCountByTeam(team, true); // -1 player + m_Players.erase(itr); + // check if the player was a participant of the match, or only entered through gm command (goname) + participant = true; + } BattlegroundScoreMap::iterator itr2 = m_PlayerScores.find(guid); if (itr2 != m_PlayerScores.end()) @@ -895,18 +905,7 @@ void Battleground::RemovePlayerAtLeave(const uint64& guid, bool Transport, bool plr->SpawnCorpseBones(); } - RemovePlayer(plr, guid); // BG subclass specific code - - bool participant = false; - // Remove from lists/maps - BattlegroundPlayerMap::iterator itr = m_Players.find(guid); - if (itr != m_Players.end()) - { - UpdatePlayersCountByTeam(team, true); // -1 player - m_Players.erase(itr); - // check if the player was a participant of the match, or only entered through gm command (goname) - participant = true; - } + RemovePlayer(plr, guid, team); // BG subclass specific code if (participant) // if the player was a match participant, remove auras, calc rating, update queue { @@ -1191,7 +1190,7 @@ void Battleground::EventPlayerLoggedOut(Player* player) if (GetStatus() == STATUS_IN_PROGRESS) { // drop flag and handle other cleanups - RemovePlayer(player, player->GetGUID()); + RemovePlayer(player, player->GetGUID(), GetPlayerTeam(player->GetGUID())); // 1 player is logging out, if it is the last, then end arena! if (isArena()) diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index f077036a635..ed9305ae0d2 100755 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -591,7 +591,7 @@ class Battleground // Scorekeeping BattlegroundScoreMap m_PlayerScores; // Player scores // must be implemented in BG subclass - virtual void RemovePlayer(Player* /*player*/, uint64 /*guid*/) {} + virtual void RemovePlayer(Player* /*player*/, uint64 /*guid*/, uint32 /*team*/) {} // Player lists, those need to be accessible by inherited classes BattlegroundPlayerMap m_Players; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAA.cpp index 922e26556ee..62a23e5d5ae 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAA.cpp @@ -62,7 +62,7 @@ void BattlegroundAA::AddPlayer(Player *plr) m_PlayerScores[plr->GetGUID()] = sc; } -void BattlegroundAA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/) +void BattlegroundAA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/, uint32 /*team*/) { } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAA.h b/src/server/game/Battlegrounds/Zones/BattlegroundAA.h index 4aeed964986..1ded667ddb9 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAA.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAA.h @@ -42,7 +42,7 @@ class BattlegroundAA : public Battleground virtual void StartingEventCloseDoors(); virtual void StartingEventOpenDoors(); - void RemovePlayer(Player *plr, uint64 guid); + void RemovePlayer(Player *plr, uint64 guid, uint32 team); void HandleAreaTrigger(Player *Source, uint32 Trigger); bool SetupBattleground(); void HandleKillPlayer(Player* player, Player* killer); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index eb645a221d4..bd2925b0740 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -215,7 +215,7 @@ void BattlegroundAB::AddPlayer(Player *plr) m_PlayerScores[plr->GetGUID()] = sc; } -void BattlegroundAB::RemovePlayer(Player* /*plr*/, uint64 /*guid*/) +void BattlegroundAB::RemovePlayer(Player* /*plr*/, uint64 /*guid*/, uint32 /*team*/) { } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h index 151b8009243..f0371040992 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h @@ -251,7 +251,7 @@ class BattlegroundAB : public Battleground void AddPlayer(Player *plr); virtual void StartingEventCloseDoors(); virtual void StartingEventOpenDoors(); - void RemovePlayer(Player *plr, uint64 guid); + void RemovePlayer(Player *plr, uint64 guid, uint32 team); void HandleAreaTrigger(Player *Source, uint32 Trigger); virtual bool SetupBattleground(); virtual void Reset(); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index f16d719cd9d..fef515de325 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -475,7 +475,7 @@ void BattlegroundAV::EndBattleground(uint32 winner) Battleground::EndBattleground(winner); } -void BattlegroundAV::RemovePlayer(Player* plr, uint64 /*guid*/) +void BattlegroundAV::RemovePlayer(Player* plr, uint64 /*guid*/, uint32 /*team*/) { if (!plr) { diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h index 4184863ea3a..653a08a46c8 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h @@ -1546,7 +1546,7 @@ class BattlegroundAV : public Battleground virtual void StartingEventCloseDoors(); virtual void StartingEventOpenDoors(); - void RemovePlayer(Player *plr, uint64 guid); + void RemovePlayer(Player *plr, uint64 guid, uint32 team); void HandleAreaTrigger(Player *Source, uint32 Trigger); bool SetupBattleground(); virtual void ResetBGSubclass(); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp index 16128b2eeee..229d24304b5 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp @@ -87,7 +87,7 @@ void BattlegroundBE::AddPlayer(Player *plr) UpdateArenaWorldState(); } -void BattlegroundBE::RemovePlayer(Player* /*plr*/, uint64 /*guid*/) +void BattlegroundBE::RemovePlayer(Player* /*plr*/, uint64 /*guid*/, uint32 /*team*/) { if (GetStatus() == STATUS_WAIT_LEAVE) return; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBE.h b/src/server/game/Battlegrounds/Zones/BattlegroundBE.h index 5db6e13df89..c4d01b9027b 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundBE.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundBE.h @@ -62,7 +62,7 @@ class BattlegroundBE : public Battleground virtual void StartingEventCloseDoors(); virtual void StartingEventOpenDoors(); - void RemovePlayer(Player *plr, uint64 guid); + void RemovePlayer(Player *plr, uint64 guid, uint32 team); void HandleAreaTrigger(Player *Source, uint32 Trigger); bool SetupBattleground(); virtual void Reset(); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index a989b255e69..e29db014a68 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -110,7 +110,7 @@ void BattlegroundDS::AddPlayer(Player *plr) UpdateArenaWorldState(); } -void BattlegroundDS::RemovePlayer(Player* /*plr*/, uint64 /*guid*/) +void BattlegroundDS::RemovePlayer(Player* /*plr*/, uint64 /*guid*/, uint32 /*team*/) { if (GetStatus() == STATUS_WAIT_LEAVE) return; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h index bc4d8e4585b..bc457c7a961 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.h @@ -71,7 +71,7 @@ class BattlegroundDS : public Battleground virtual void StartingEventCloseDoors(); virtual void StartingEventOpenDoors(); - void RemovePlayer(Player *plr, uint64 guid); + void RemovePlayer(Player *plr, uint64 guid, uint32 team); void HandleAreaTrigger(Player *Source, uint32 Trigger); bool SetupBattleground(); virtual void Reset(); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index 9ca8164b572..beb468ac8da 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -343,7 +343,7 @@ void BattlegroundEY::AddPlayer(Player *plr) m_PlayerScores[plr->GetGUID()] = sc; } -void BattlegroundEY::RemovePlayer(Player *plr, uint64 guid) +void BattlegroundEY::RemovePlayer(Player *plr, uint64 guid, uint32 /*team*/) { // sometimes flag aura not removed :( for (int j = EY_POINTS_MAX; j >= 0; --j) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h index 7161de16bce..3609b8b44d8 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h @@ -348,7 +348,7 @@ class BattlegroundEY : public Battleground void RespawnFlag(bool send_message); void RespawnFlagAfterDrop(); - void RemovePlayer(Player *plr, uint64 guid); + void RemovePlayer(Player *plr, uint64 guid, uint32 team); void HandleBuffUse(uint64 const& buff_guid); void HandleAreaTrigger(Player *Source, uint32 Trigger); void HandleKillPlayer(Player* player, Player* killer); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index 8135beb5c92..bd3125ff18d 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -310,7 +310,7 @@ void BattlegroundIC::AddPlayer(Player *plr) SendTransportInit(plr); } -void BattlegroundIC::RemovePlayer(Player* plr, uint64 /*guid*/) +void BattlegroundIC::RemovePlayer(Player* plr, uint64 /*guid*/, uint32 /*team*/) { plr->RemoveAura(SPELL_QUARRY); plr->RemoveAura(SPELL_OIL_REFINERY); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h index 95cdf1017d8..af7e72de7d4 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h @@ -869,7 +869,7 @@ class BattlegroundIC : public Battleground virtual void StartingEventCloseDoors(); virtual void StartingEventOpenDoors(); - void RemovePlayer(Player *plr, uint64 guid); + void RemovePlayer(Player *plr, uint64 guid, uint32 team); void HandleAreaTrigger(Player *Source, uint32 Trigger); bool SetupBattleground(); void SpawnLeader(uint32 teamid); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp index 6ecdcdadd68..1844f93ecdd 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp @@ -84,7 +84,7 @@ void BattlegroundNA::AddPlayer(Player *plr) UpdateArenaWorldState(); } -void BattlegroundNA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/) +void BattlegroundNA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/, uint32 /*team*/) { if (GetStatus() == STATUS_WAIT_LEAVE) return; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundNA.h b/src/server/game/Battlegrounds/Zones/BattlegroundNA.h index 6ae4c77b1e4..1eeffc80e2b 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundNA.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundNA.h @@ -63,7 +63,7 @@ class BattlegroundNA : public Battleground virtual void StartingEventCloseDoors(); virtual void StartingEventOpenDoors(); - void RemovePlayer(Player *plr, uint64 guid); + void RemovePlayer(Player *plr, uint64 guid, uint32 team); void HandleAreaTrigger(Player *Source, uint32 Trigger); bool SetupBattleground(); virtual void Reset(); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRB.cpp index 9b88dff5352..54bb64a1603 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRB.cpp @@ -57,7 +57,7 @@ void BattlegroundRB::AddPlayer(Player *plr) m_PlayerScores[plr->GetGUID()] = sc; } -void BattlegroundRB::RemovePlayer(Player* /*plr*/, uint64 /*guid*/) +void BattlegroundRB::RemovePlayer(Player* /*plr*/, uint64 /*guid*/, uint32 /*team*/) { } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRB.h b/src/server/game/Battlegrounds/Zones/BattlegroundRB.h index 7a521ae489f..47c31bcd302 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRB.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRB.h @@ -41,7 +41,7 @@ class BattlegroundRB : public Battleground virtual void StartingEventCloseDoors(); virtual void StartingEventOpenDoors(); - void RemovePlayer(Player *plr, uint64 guid); + void RemovePlayer(Player *plr, uint64 guid, uint32 team); void HandleAreaTrigger(Player *Source, uint32 Trigger); /* Scorekeeping */ diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp index 5a67a787cb0..20005863de2 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp @@ -84,7 +84,7 @@ void BattlegroundRL::AddPlayer(Player *plr) UpdateArenaWorldState(); } -void BattlegroundRL::RemovePlayer(Player* /*plr*/, uint64 /*guid*/) +void BattlegroundRL::RemovePlayer(Player* /*plr*/, uint64 /*guid*/, uint32 /*team*/) { if (GetStatus() == STATUS_WAIT_LEAVE) return; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRL.h b/src/server/game/Battlegrounds/Zones/BattlegroundRL.h index 84b4d939678..7977e2945f4 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRL.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRL.h @@ -61,7 +61,7 @@ class BattlegroundRL : public Battleground virtual void StartingEventCloseDoors(); virtual void StartingEventOpenDoors(); - void RemovePlayer(Player *plr, uint64 guid); + void RemovePlayer(Player *plr, uint64 guid, uint32 team); void HandleAreaTrigger(Player *Source, uint32 Trigger); bool SetupBattleground(); void HandleKillPlayer(Player* player, Player* killer); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp index 9a5d57b6d6c..c8761303a52 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.cpp @@ -131,7 +131,7 @@ void BattlegroundRV::AddPlayer(Player *plr) UpdateWorldState(BG_RV_WORLD_STATE_H, GetAlivePlayersCountByTeam(HORDE)); } -void BattlegroundRV::RemovePlayer(Player* /*plr*/, uint64 /*guid*/) +void BattlegroundRV::RemovePlayer(Player* /*plr*/, uint64 /*guid*/, uint32 /*team*/) { if (GetStatus() == STATUS_WAIT_LEAVE) return; diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h index 7674bc459d0..9722eb057c7 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRV.h @@ -118,7 +118,7 @@ class BattlegroundRV : public Battleground virtual void Reset(); virtual void FillInitialWorldStates(WorldPacket &d); - void RemovePlayer(Player *plr, uint64 guid); + void RemovePlayer(Player *plr, uint64 guid, uint32 team); void HandleAreaTrigger(Player *Source, uint32 Trigger); bool SetupBattleground(); void HandleKillPlayer(Player* player, Player* killer); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index 7399a106872..05cf6fb4240 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -465,7 +465,7 @@ void BattlegroundSA::AddPlayer(Player *plr) m_PlayerScores[plr->GetGUID()] = sc; } -void BattlegroundSA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/) +void BattlegroundSA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/, uint32 /*team*/) { } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h index df753df3020..33a4bd9ad3f 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h @@ -481,7 +481,7 @@ class BattlegroundSA : public Battleground void EndBattleground(uint32 winner); /// CAlled when a player leave battleground - void RemovePlayer(Player *plr, uint64 guid); + void RemovePlayer(Player *plr, uint64 guid, uint32 team); void HandleAreaTrigger(Player *Source, uint32 Trigger); /* Scorekeeping */ diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index e9355bc95f2..7064beb7735 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -559,7 +559,7 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT); } -void BattlegroundWS::RemovePlayer(Player *plr, uint64 guid) +void BattlegroundWS::RemovePlayer(Player *plr, uint64 guid, uint32 /*team*/) { // sometimes flag aura not removed :( if (IsAllianceFlagPickedup() && m_FlagKeepers[BG_TEAM_ALLIANCE] == guid) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h index 6bffd479da0..8917110fb15 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.h @@ -190,7 +190,7 @@ class BattlegroundWS : public Battleground virtual void EventPlayerClickedOnFlag(Player *Source, GameObject* target_obj); virtual void EventPlayerCapturedFlag(Player *Source); - void RemovePlayer(Player *plr, uint64 guid); + void RemovePlayer(Player *plr, uint64 guid, uint32 team); void HandleAreaTrigger(Player *Source, uint32 Trigger); void HandleKillPlayer(Player* player, Player* killer); bool SetupBattleground(); |
