[10800] Use ObjectGuid in some battleground structures.

Also fix some catches bugs in code in result.
This commit is contained in:
VladimirMangos 2010-12-01 11:20:17 +03:00
parent ce7b98c45e
commit 6d13cd6553
33 changed files with 146 additions and 139 deletions

View file

@ -202,7 +202,7 @@ template<class Do>
void BattleGround::BroadcastWorker(Do& _do)
{
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
if (Player *plr = ObjectAccessor::FindPlayer(ObjectGuid(HIGHGUID_PLAYER, itr->first)))
if (Player *plr = ObjectAccessor::FindPlayer(itr->first))
_do(plr);
}
@ -457,7 +457,7 @@ void BattleGround::Update(uint32 diff)
{
//TODO : add arena sound PlaySoundToAll(SOUND_ARENA_START);
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
if (Player *plr = sObjectMgr.GetPlayer(itr->first))
plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
@ -468,7 +468,7 @@ void BattleGround::Update(uint32 diff)
PlaySoundToAll(SOUND_BG_START);
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
if (Player* plr = sObjectMgr.GetPlayer(itr->first))
plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
//Announce BG starting
@ -522,11 +522,11 @@ void BattleGround::SendPacketToAll(WorldPacket *packet)
{
if (itr->second.OfflineRemoveTime)
continue;
Player *plr = sObjectMgr.GetPlayer(itr->first);
if (plr)
if (Player *plr = sObjectMgr.GetPlayer(itr->first))
plr->GetSession()->SendPacket(packet);
else
sLog.outError("BattleGround:SendPacketToAll: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
sLog.outError("BattleGround:SendPacketToAll: %s not found!", itr->first.GetString().c_str());
}
}
@ -536,10 +536,11 @@ void BattleGround::SendPacketToTeam(Team teamId, WorldPacket *packet, Player *se
{
if (itr->second.OfflineRemoveTime)
continue;
Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr)
{
sLog.outError("BattleGround:SendPacketToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
sLog.outError("BattleGround:SendPacketToTeam: %s not found!", itr->first.GetString().c_str());
continue;
}
@ -569,11 +570,11 @@ void BattleGround::PlaySoundToTeam(uint32 SoundID, Team teamId)
{
if (itr->second.OfflineRemoveTime)
continue;
Player *plr = sObjectMgr.GetPlayer(itr->first);
Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr)
{
sLog.outError("BattleGround:PlaySoundToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
sLog.outError("BattleGround:PlaySoundToTeam: %s not found!", itr->first.GetString().c_str());
continue;
}
@ -594,11 +595,12 @@ void BattleGround::CastSpellOnTeam(uint32 SpellID, Team teamId)
{
if (itr->second.OfflineRemoveTime)
continue;
Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr)
{
sLog.outError("BattleGround:CastSpellOnTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
sLog.outError("BattleGround:CastSpellOnTeam: %s not found!", itr->first.GetString().c_str());
continue;
}
@ -616,11 +618,12 @@ void BattleGround::RewardHonorToTeam(uint32 Honor, Team teamId)
{
if (itr->second.OfflineRemoveTime)
continue;
Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr)
{
sLog.outError("BattleGround:RewardHonorToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
sLog.outError("BattleGround:RewardHonorToTeam: %s not found!", itr->first.GetString().c_str());
continue;
}
@ -643,11 +646,12 @@ void BattleGround::RewardReputationToTeam(uint32 faction_id, uint32 Reputation,
{
if (itr->second.OfflineRemoveTime)
continue;
Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr)
{
sLog.outError("BattleGround:RewardReputationToTeam: Player (GUID: %u) not found!", GUID_LOPART(itr->first));
sLog.outError("BattleGround:RewardReputationToTeam: %s not found!", itr->first.GetString().c_str());
continue;
}
@ -747,10 +751,11 @@ void BattleGround::EndBattleGround(Team winner)
}
continue;
}
Player *plr = sObjectMgr.GetPlayer(itr->first);
if (!plr)
{
sLog.outError("BattleGround:EndBattleGround Player (GUID: %u) not found!", GUID_LOPART(itr->first));
sLog.outError("BattleGround:EndBattleGround %s not found!", itr->first.GetString().c_str());
continue;
}
@ -993,7 +998,7 @@ void BattleGround::BlockMovement(Player *plr)
plr->SetClientControl(plr, 0); // movement disabled NOTE: the effect will be automatically removed by client when the player is teleported from the battleground, so no need to send with uint8(1) in RemovePlayerAtLeave()
}
void BattleGround::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPacket)
void BattleGround::RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool SendPacket)
{
Team team = GetPlayerTeam(guid);
bool participant = false;
@ -1183,7 +1188,7 @@ void BattleGround::AddPlayer(Player *plr)
bp.PlayerTeam = team;
// Add to list/maps
m_Players[guid.GetRawValue()] = bp;
m_Players[guid] = bp;
UpdatePlayersCountByTeam(team, false); // +1 player
@ -1267,10 +1272,10 @@ void BattleGround::AddOrSetPlayerToCorrectBgGroup(Player *plr, ObjectGuid plr_gu
}
// This method should be called when player logs into running battleground
void BattleGround::EventPlayerLoggedIn(Player* player, uint64 plr_guid)
void BattleGround::EventPlayerLoggedIn(Player* player, ObjectGuid plr_guid)
{
// player is correct pointer
for(std::deque<uint64>::iterator itr = m_OfflineQueue.begin(); itr != m_OfflineQueue.end(); ++itr)
for(OfflineQueue::iterator itr = m_OfflineQueue.begin(); itr != m_OfflineQueue.end(); ++itr)
{
if (*itr == plr_guid)
{
@ -1288,12 +1293,12 @@ void BattleGround::EventPlayerLoggedIn(Player* player, uint64 plr_guid)
void BattleGround::EventPlayerLoggedOut(Player* player)
{
// player is correct pointer, it is checked in WorldSession::LogoutPlayer()
m_OfflineQueue.push_back(player->GetGUID());
m_Players[player->GetGUID()].OfflineRemoveTime = sWorld.GetGameTime() + MAX_OFFLINE_TIME;
m_OfflineQueue.push_back(player->GetObjectGuid());
m_Players[player->GetObjectGuid()].OfflineRemoveTime = sWorld.GetGameTime() + MAX_OFFLINE_TIME;
if (GetStatus() == STATUS_IN_PROGRESS)
{
// drop flag and handle other cleanups
RemovePlayer(player, player->GetGUID());
RemovePlayer(player, player->GetObjectGuid());
// 1 player is logging out, if it is the last, then end arena!
if (isArena())
@ -1347,7 +1352,7 @@ bool BattleGround::HasFreeSlots() const
void BattleGround::UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
{
//this procedure is called from virtual function implemented in bg subclass
BattleGroundScoreMap::const_iterator itr = m_PlayerScores.find(Source->GetGUID());
BattleGroundScoreMap::const_iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
if(itr == m_PlayerScores.end()) // player not found...
return;
@ -1751,7 +1756,7 @@ void BattleGround::HandleKillPlayer( Player *player, Player *killer )
// return the player's team based on battlegroundplayer info
// used in same faction arena matches mainly
Team BattleGround::GetPlayerTeam(uint64 guid)
Team BattleGround::GetPlayerTeam(ObjectGuid guid)
{
BattleGroundPlayerMap::const_iterator itr = m_Players.find(guid);
if (itr != m_Players.end())
@ -1759,7 +1764,7 @@ Team BattleGround::GetPlayerTeam(uint64 guid)
return TEAM_NONE;
}
bool BattleGround::IsPlayerInBattleGround(uint64 guid)
bool BattleGround::IsPlayerInBattleGround(ObjectGuid guid)
{
BattleGroundPlayerMap::const_iterator itr = m_Players.find(guid);
if (itr != m_Players.end())

View file

@ -375,11 +375,11 @@ class BattleGround
bool isBattleGround() const { return !m_IsArena; }
bool isRated() const { return m_IsRated; }
typedef std::map<uint64, BattleGroundPlayer> BattleGroundPlayerMap;
typedef std::map<ObjectGuid, BattleGroundPlayer> BattleGroundPlayerMap;
BattleGroundPlayerMap const& GetPlayers() const { return m_Players; }
uint32 GetPlayersSize() const { return m_Players.size(); }
typedef std::map<uint64, BattleGroundScore*> BattleGroundScoreMap;
typedef std::map<ObjectGuid, BattleGroundScore*> BattleGroundScoreMap;
BattleGroundScoreMap::const_iterator GetPlayerScoresBegin() const { return m_PlayerScores.begin(); }
BattleGroundScoreMap::const_iterator GetPlayerScoresEnd() const { return m_PlayerScores.end(); }
uint32 GetPlayerScoresSize() const { return m_PlayerScores.size(); }
@ -475,7 +475,7 @@ class BattleGround
virtual void EventPlayerDroppedFlag(Player* /*player*/) {}
virtual void EventPlayerClickedOnFlag(Player* /*player*/, GameObject* /*target_obj*/) {}
virtual void EventPlayerCapturedFlag(Player* /*player*/) {}
void EventPlayerLoggedIn(Player* player, uint64 plr_guid);
void EventPlayerLoggedIn(Player* player, ObjectGuid plr_guid);
void EventPlayerLoggedOut(Player* player);
/* Death related */
@ -485,7 +485,7 @@ class BattleGround
void AddOrSetPlayerToCorrectBgGroup(Player *plr, ObjectGuid plr_guid, Team team);
virtual void RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPacket);
virtual void RemovePlayerAtLeave(ObjectGuid guid, bool Transport, bool SendPacket);
// can be extended in in BG subclass
/* event related */
@ -524,10 +524,10 @@ class BattleGround
virtual bool HandlePlayerUnderMap(Player * /*plr*/) { return false; }
// since arenas can be AvA or Hvh, we have to get the "temporary" team of a player
Team GetPlayerTeam(uint64 guid);
Team GetPlayerTeam(ObjectGuid guid);
static Team GetOtherTeam(Team team){ return team ? ((team == ALLIANCE) ? HORDE : ALLIANCE) : TEAM_NONE; }
static BattleGroundTeamIndex GetOtherTeamIndex(BattleGroundTeamIndex teamIdx){ return teamIdx == BG_TEAM_ALLIANCE ? BG_TEAM_HORDE : BG_TEAM_ALLIANCE; }
bool IsPlayerInBattleGround(uint64 guid);
bool IsPlayerInBattleGround(ObjectGuid guid);
/* virtual score-array - get's used in bg-subclasses */
int32 m_TeamScores[BG_TEAMS_COUNT];
@ -557,7 +557,7 @@ class BattleGround
BattleGroundScoreMap m_PlayerScores; // Player scores
// must be implemented in BG subclass
virtual void RemovePlayer(Player * /*player*/, uint64 /*guid*/) {}
virtual void RemovePlayer(Player * /*player*/, ObjectGuid /*guid*/) {}
/* Player lists, those need to be accessible by inherited classes */
BattleGroundPlayerMap m_Players;
@ -592,8 +592,8 @@ class BattleGround
char const *m_Name;
/* Player lists */
std::vector<uint64> m_ResurrectQueue; // Player GUID
std::deque<uint64> m_OfflineQueue; // Player GUID
typedef std::deque<ObjectGuid> OfflineQueue;
OfflineQueue m_OfflineQueue; // Player GUID
/* Invited counters are useful for player invitation to BG - do not allow, if BG is started to one faction to have 2 more players than another faction */
/* Invited counters will be changed only when removing already invited player from queue, removing player from battleground and inviting player to BG */

View file

@ -59,10 +59,10 @@ void BattleGroundAA::AddPlayer(Player *plr)
//create score and add it to map, default values are set in constructor
BattleGroundAAScore* sc = new BattleGroundAAScore;
m_PlayerScores[plr->GetGUID()] = sc;
m_PlayerScores[plr->GetObjectGuid()] = sc;
}
void BattleGroundAA::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
void BattleGroundAA::RemovePlayer(Player * /*plr*/, ObjectGuid /*guid*/)
{
}

View file

@ -42,7 +42,7 @@ class BattleGroundAA : public BattleGround
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid);
void RemovePlayer(Player *plr, ObjectGuid guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleGround();
void HandleKillPlayer(Player* player, Player *killer);

View file

@ -182,10 +182,10 @@ void BattleGroundAB::AddPlayer(Player *plr)
//create score and add it to map, default values are set in the constructor
BattleGroundABScore* sc = new BattleGroundABScore;
m_PlayerScores[plr->GetGUID()] = sc;
m_PlayerScores[plr->GetObjectGuid()] = sc;
}
void BattleGroundAB::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
void BattleGroundAB::RemovePlayer(Player * /*plr*/, ObjectGuid /*guid*/)
{
}
@ -539,7 +539,7 @@ WorldSafeLocsEntry const* BattleGroundAB::GetClosestGraveYard(Player* player)
void BattleGroundAB::UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
{
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
if( itr == m_PlayerScores.end() ) // player not found...
return;

View file

@ -184,7 +184,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, ObjectGuid guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
virtual bool SetupBattleGround();
virtual void Reset();

View file

@ -289,7 +289,7 @@ void BattleGroundAV::AddPlayer(Player *plr)
BattleGround::AddPlayer(plr);
// create score and add it to map, default values are set in constructor
BattleGroundAVScore* sc = new BattleGroundAVScore;
m_PlayerScores[plr->GetGUID()] = sc;
m_PlayerScores[plr->GetObjectGuid()] = sc;
}
void BattleGroundAV::EndBattleGround(Team winner)
@ -349,7 +349,7 @@ void BattleGroundAV::EndBattleGround(Team winner)
BattleGround::EndBattleGround(winner);
}
void BattleGroundAV::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
void BattleGroundAV::RemovePlayer(Player* /*plr*/, ObjectGuid /*guid*/)
{
}
@ -389,7 +389,7 @@ void BattleGroundAV::HandleAreaTrigger(Player *Source, uint32 Trigger)
void BattleGroundAV::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
{
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
if(itr == m_PlayerScores.end()) // player not found...
return;

View file

@ -326,7 +326,7 @@ class BattleGroundAV : public BattleGround
// world states
virtual void FillInitialWorldStates(WorldPacket& data, uint32& count);
void RemovePlayer(Player *plr,uint64 guid);
void RemovePlayer(Player *plr, ObjectGuid guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
virtual void Reset();

View file

@ -67,13 +67,13 @@ void BattleGroundBE::AddPlayer(Player *plr)
//create score and add it to map, default values are set in constructor
BattleGroundBEScore* sc = new BattleGroundBEScore;
m_PlayerScores[plr->GetGUID()] = sc;
m_PlayerScores[plr->GetObjectGuid()] = sc;
UpdateWorldState(0x9f1, GetAlivePlayersCountByTeam(ALLIANCE));
UpdateWorldState(0x9f0, GetAlivePlayersCountByTeam(HORDE));
}
void BattleGroundBE::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
void BattleGroundBE::RemovePlayer(Player* /*plr*/, ObjectGuid /*guid*/)
{
if (GetStatus() == STATUS_WAIT_LEAVE)
return;
@ -156,12 +156,12 @@ bool BattleGroundBE::SetupBattleGround()
void BattleGroundBE::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
{
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
if(itr == m_PlayerScores.end()) // player not found...
return;
//there is nothing special in this score
BattleGround::UpdatePlayerScore(Source,type,value);
BattleGround::UpdatePlayerScore(Source, type, value);
}

View file

@ -41,7 +41,7 @@ class BattleGroundBE : public BattleGround
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid);
void RemovePlayer(Player *plr, ObjectGuid guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleGround();
virtual void Reset();

View file

@ -59,10 +59,10 @@ void BattleGroundDS::AddPlayer(Player *plr)
//create score and add it to map, default values are set in constructor
BattleGroundDSScore* sc = new BattleGroundDSScore;
m_PlayerScores[plr->GetGUID()] = sc;
m_PlayerScores[plr->GetObjectGuid()] = sc;
}
void BattleGroundDS::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
void BattleGroundDS::RemovePlayer(Player * /*plr*/, ObjectGuid /*guid*/)
{
}

View file

@ -42,7 +42,7 @@ class BattleGroundDS : public BattleGround
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid);
void RemovePlayer(Player *plr, ObjectGuid guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleGround();
void HandleKillPlayer(Player* player, Player *killer);

View file

@ -134,7 +134,7 @@ void BattleGroundEY::CheckSomeoneJoinedPoint()
Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS][j]);
if (!plr)
{
sLog.outError("BattleGroundEY:CheckSomeoneJoinedPoint: Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS][j]));
sLog.outError("BattleGroundEY:CheckSomeoneJoinedPoint: %s not found!", m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS][j].GetString().c_str());
++j;
continue;
}
@ -170,7 +170,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[i][j]);
if (!plr)
{
sLog.outError("BattleGroundEY:CheckSomeoneLeftPoint Player (GUID: %u) not found!", GUID_LOPART(m_PlayersNearPoint[i][j]));
sLog.outError("BattleGroundEY:CheckSomeoneLeftPoint %s not found!", m_PlayersNearPoint[i][j].GetString().c_str());
//move nonexistent player to "free space" - this will cause many error showing in log, but it is a very important bug
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(m_PlayersNearPoint[i][j]);
m_PlayersNearPoint[i].erase(m_PlayersNearPoint[i].begin() + j);
@ -222,8 +222,7 @@ void BattleGroundEY::UpdatePointStatuses()
for (uint8 i = 0; i < m_PlayersNearPoint[point].size(); ++i)
{
Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[point][i]);
if (plr)
if (Player *plr = sObjectMgr.GetPlayer(m_PlayersNearPoint[point][i]))
{
UpdateWorldStateForPlayer(PROGRESS_BAR_STATUS, m_PointBarStatus[point], plr);
//if point owner changed we must evoke event!
@ -307,12 +306,12 @@ void BattleGroundEY::AddPlayer(Player *plr)
//create score and add it to map
BattleGroundEYScore* sc = new BattleGroundEYScore;
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(plr->GetGUID());
m_PlayersNearPoint[BG_EY_PLAYERS_OUT_OF_POINTS].push_back(plr->GetObjectGuid());
m_PlayerScores[plr->GetGUID()] = sc;
m_PlayerScores[plr->GetObjectGuid()] = sc;
}
void BattleGroundEY::RemovePlayer(Player *plr, uint64 guid)
void BattleGroundEY::RemovePlayer(Player *plr, ObjectGuid guid)
{
// sometimes flag aura not removed :(
for (int j = BG_EY_NODES_MAX; j >= 0; --j)
@ -329,7 +328,7 @@ void BattleGroundEY::RemovePlayer(Player *plr, uint64 guid)
EventPlayerDroppedFlag(plr);
else
{
SetFlagPicker(0);
ClearFlagPicker();
RespawnFlag(true);
}
}
@ -348,22 +347,22 @@ void BattleGroundEY::HandleAreaTrigger(Player *Source, uint32 Trigger)
{
case TR_BLOOD_ELF_POINT:
if (m_PointState[BG_EY_NODE_BLOOD_ELF] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_BLOOD_ELF] == Source->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
if (m_FlagState && GetFlagPickerGuid() == Source->GetObjectGuid())
EventPlayerCapturedFlag(Source, BG_EY_NODE_BLOOD_ELF);
break;
case TR_FEL_REAVER_POINT:
if (m_PointState[BG_EY_NODE_FEL_REAVER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_FEL_REAVER] == Source->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
if (m_FlagState && GetFlagPickerGuid() == Source->GetObjectGuid())
EventPlayerCapturedFlag(Source, BG_EY_NODE_FEL_REAVER);
break;
case TR_MAGE_TOWER_POINT:
if (m_PointState[BG_EY_NODE_MAGE_TOWER] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_MAGE_TOWER] == Source->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
if (m_FlagState && GetFlagPickerGuid() == Source->GetObjectGuid())
EventPlayerCapturedFlag(Source, BG_EY_NODE_MAGE_TOWER);
break;
case TR_DRAENEI_RUINS_POINT:
if (m_PointState[BG_EY_NODE_DRAENEI_RUINS] == EY_POINT_UNDER_CONTROL && m_PointOwnedByTeam[BG_EY_NODE_DRAENEI_RUINS] == Source->GetTeam())
if (m_FlagState && GetFlagPickerGUID() == Source->GetGUID())
if (m_FlagState && GetFlagPickerGuid() == Source->GetObjectGuid())
EventPlayerCapturedFlag(Source, BG_EY_NODE_DRAENEI_RUINS);
break;
case 4512:
@ -418,7 +417,7 @@ void BattleGroundEY::Reset()
m_HonorScoreTics[BG_TEAM_ALLIANCE] = 0;
m_HonorScoreTics[BG_TEAM_HORDE] = 0;
m_FlagState = BG_EY_FLAG_STATE_ON_BASE;
m_FlagKeeper = 0;
m_FlagKeeper.Clear();
m_DroppedFlagGUID = 0;
m_PointAddingTimer = 0;
m_TowerCapCheckTimer = 0;
@ -484,9 +483,9 @@ void BattleGroundEY::EventPlayerDroppedFlag(Player *Source)
{
// if not running, do not cast things at the dropper player, neither send unnecessary messages
// just take off the aura
if (IsFlagPickedup() && GetFlagPickerGUID() == Source->GetGUID())
if (IsFlagPickedup() && GetFlagPickerGuid() == Source->GetObjectGuid())
{
SetFlagPicker(0);
ClearFlagPicker();
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
}
return;
@ -495,10 +494,10 @@ void BattleGroundEY::EventPlayerDroppedFlag(Player *Source)
if (!IsFlagPickedup())
return;
if (GetFlagPickerGUID() != Source->GetGUID())
if (GetFlagPickerGuid() != Source->GetObjectGuid())
return;
SetFlagPicker(0);
ClearFlagPicker();
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
m_FlagState = BG_EY_FLAG_STATE_ON_GROUND;
m_FlagsTimer = BG_EY_FLAG_RESPAWN_TIME;
@ -537,7 +536,7 @@ void BattleGroundEY::EventPlayerClickedOnFlag(Player *Source, GameObject* target
// despawn center-flag
SpawnEvent(BG_EY_EVENT_CAPTURE_FLAG, BG_EY_EVENT2_FLAG_CENTER, false);
SetFlagPicker(Source->GetGUID());
SetFlagPicker(Source->GetObjectGuid());
//get flag aura on player
Source->CastSpell(Source, BG_EY_NETHERSTORM_FLAG_SPELL, true);
Source->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_ENTER_PVP_COMBAT);
@ -608,10 +607,10 @@ void BattleGroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point)
void BattleGroundEY::EventPlayerCapturedFlag(Player *Source, BG_EY_Nodes node)
{
if (GetStatus() != STATUS_IN_PROGRESS || GetFlagPickerGUID() != Source->GetGUID())
if (GetStatus() != STATUS_IN_PROGRESS || GetFlagPickerGuid() != Source->GetObjectGuid())
return;
SetFlagPicker(0);
ClearFlagPicker();
m_FlagState = BG_EY_FLAG_STATE_WAIT_RESPAWN;
Source->RemoveAurasDueToSpell(BG_EY_NETHERSTORM_FLAG_SPELL);
@ -646,7 +645,7 @@ void BattleGroundEY::EventPlayerCapturedFlag(Player *Source, BG_EY_Nodes node)
void BattleGroundEY::UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
{
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
if(itr == m_PlayerScores.end()) // player not found
return;

View file

@ -254,14 +254,15 @@ class BattleGroundEY : public BattleGround
virtual void StartingEventOpenDoors();
/* BG Flags */
uint64 GetFlagPickerGUID() const { return m_FlagKeeper; }
void SetFlagPicker(uint64 guid) { m_FlagKeeper = guid; }
bool IsFlagPickedup() const { return m_FlagKeeper != 0; }
ObjectGuid const& GetFlagPickerGuid() const { return m_FlagKeeper; }
void SetFlagPicker(ObjectGuid guid) { m_FlagKeeper = guid; }
void ClearFlagPicker() { m_FlagKeeper.Clear(); }
bool IsFlagPickedup() const { return !m_FlagKeeper.IsEmpty(); }
uint8 GetFlagState() const { return m_FlagState; }
void RespawnFlag(bool send_message);
void RespawnFlagAfterDrop();
void RemovePlayer(Player *plr,uint64 guid);
void RemovePlayer(Player *plr, ObjectGuid guid);
void HandleBuffUse(uint64 const& buff_guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void HandleKillPlayer(Player *player, Player *killer);
@ -306,7 +307,7 @@ class BattleGroundEY : public BattleGround
uint32 m_Points_Trigger[BG_EY_NODES_MAX];
uint64 m_FlagKeeper; // keepers guid
ObjectGuid m_FlagKeeper; // keepers guid
uint64 m_DroppedFlagGUID;
uint8 m_FlagState; // for checking flag state
int32 m_FlagsTimer;
@ -315,7 +316,7 @@ class BattleGroundEY : public BattleGround
Team m_PointOwnedByTeam[BG_EY_NODES_MAX];
uint8 m_PointState[BG_EY_NODES_MAX];
int32 m_PointBarStatus[BG_EY_NODES_MAX];
typedef std::vector<uint64> PlayersNearPointType;
typedef std::vector<ObjectGuid> PlayersNearPointType;
PlayersNearPointType m_PlayersNearPoint[BG_EY_NODES_MAX_WITH_SPEIAL];
uint8 m_CurrentPointPlayersCount[2*BG_EY_NODES_MAX];

View file

@ -229,11 +229,11 @@ void WorldSession::HandleBattleGroundPlayerPositionsOpcode( WorldPacket & /*recv
uint32 count1 = 0; // always constant zero?
uint32 count2 = 0; // count of next fields
Player *ali_plr = sObjectMgr.GetPlayer(((BattleGroundWS*)bg)->GetAllianceFlagPickerGUID());
Player *ali_plr = sObjectMgr.GetPlayer(((BattleGroundWS*)bg)->GetAllianceFlagPickerGuid());
if (ali_plr)
++count2;
Player *horde_plr = sObjectMgr.GetPlayer(((BattleGroundWS*)bg)->GetHordeFlagPickerGUID());
Player *horde_plr = sObjectMgr.GetPlayer(((BattleGroundWS*)bg)->GetHordeFlagPickerGuid());
if (horde_plr)
++count2;
@ -430,7 +430,7 @@ void WorldSession::HandleBattleFieldPortOpcode( WorldPacket &recv_data )
// this is still needed here if battleground "jumping" shouldn't add deserter debuff
// also this is required to prevent stuck at old battleground after SetBattleGroundId set to new
if (BattleGround *currentBg = _player->GetBattleGround())
currentBg->RemovePlayerAtLeave(_player->GetGUID(), false, true);
currentBg->RemovePlayerAtLeave(_player->GetObjectGuid(), false, true);
// set the destination instance id
_player->SetBattleGroundId(bg->GetInstanceID(), bgTypeId);

View file

@ -54,10 +54,10 @@ void BattleGroundIC::AddPlayer(Player *plr)
//create score and add it to map, default values are set in constructor
BattleGroundICScore* sc = new BattleGroundICScore;
m_PlayerScores[plr->GetGUID()] = sc;
m_PlayerScores[plr->GetObjectGuid()] = sc;
}
void BattleGroundIC::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
void BattleGroundIC::RemovePlayer(Player* /*plr*/, ObjectGuid /*guid*/)
{
}
@ -72,7 +72,7 @@ void BattleGroundIC::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
void BattleGroundIC::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
{
std::map<uint64, BattleGroundScore*>::iterator itr = m_PlayerScores.find(Source->GetGUID());
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
if(itr == m_PlayerScores.end()) // player not found...
return;

View file

@ -42,7 +42,7 @@ class BattleGroundIC : public BattleGround
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr,uint64 guid);
void RemovePlayer(Player *plr, ObjectGuid guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
//bool SetupBattleGround();

View file

@ -1303,7 +1303,7 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
for(BattleGround::BattleGroundScoreMap::const_iterator itr = bg->GetPlayerScoresBegin(); itr != bg->GetPlayerScoresEnd(); ++itr)
{
*data << (uint64)itr->first;
*data << ObjectGuid(itr->first);
*data << (int32)itr->second->KillingBlows;
if (type == 0)
{
@ -1388,10 +1388,10 @@ void BattleGroundMgr::BuildPlaySoundPacket(WorldPacket *data, uint32 soundid)
*data << uint32(soundid);
}
void BattleGroundMgr::BuildPlayerLeftBattleGroundPacket(WorldPacket *data, const uint64& guid)
void BattleGroundMgr::BuildPlayerLeftBattleGroundPacket(WorldPacket *data, ObjectGuid guid)
{
data->Initialize(SMSG_BATTLEGROUND_PLAYER_LEFT, 8);
*data << uint64(guid);
*data << ObjectGuid(guid);
}
void BattleGroundMgr::BuildPlayerJoinedBattleGroundPacket(WorldPacket *data, Player *plr)

View file

@ -191,7 +191,7 @@ class BattleGroundMgr
/* Packet Building */
void BuildPlayerJoinedBattleGroundPacket(WorldPacket *data, Player *plr);
void BuildPlayerLeftBattleGroundPacket(WorldPacket *data, const uint64& guid);
void BuildPlayerLeftBattleGroundPacket(WorldPacket *data, ObjectGuid guid);
void BuildBattleGroundListPacket(WorldPacket *data, ObjectGuid guid, Player *plr, BattleGroundTypeId bgTypeId, uint8 fromWhere);
void BuildGroupJoinedBattlegroundPacket(WorldPacket *data, GroupJoinBattlegroundResult result);
void BuildUpdateWorldStatePacket(WorldPacket *data, uint32 field, uint32 value);

View file

@ -67,13 +67,13 @@ void BattleGroundNA::AddPlayer(Player *plr)
//create score and add it to map, default values are set in constructor
BattleGroundNAScore* sc = new BattleGroundNAScore;
m_PlayerScores[plr->GetGUID()] = sc;
m_PlayerScores[plr->GetObjectGuid()] = sc;
UpdateWorldState(0xa0f, GetAlivePlayersCountByTeam(ALLIANCE));
UpdateWorldState(0xa10, GetAlivePlayersCountByTeam(HORDE));
}
void BattleGroundNA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
void BattleGroundNA::RemovePlayer(Player* /*plr*/, ObjectGuid /*guid*/)
{
if (GetStatus() == STATUS_WAIT_LEAVE)
return;

View file

@ -42,7 +42,7 @@ class BattleGroundNA : public BattleGround
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid);
void RemovePlayer(Player *plr, ObjectGuid guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleGround();
virtual void Reset();

View file

@ -54,10 +54,10 @@ void BattleGroundRB::AddPlayer(Player *plr)
//create score and add it to map, default values are set in constructor
BattleGroundABGScore* sc = new BattleGroundABGScore;
m_PlayerScores[plr->GetGUID()] = sc;
m_PlayerScores[plr->GetObjectGuid()] = sc;
}
void BattleGroundRB::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
void BattleGroundRB::RemovePlayer(Player* /*plr*/, ObjectGuid /*guid*/)
{
}
@ -72,7 +72,7 @@ void BattleGroundRB::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
void BattleGroundRB::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
{
std::map<uint64, BattleGroundScore*>::iterator itr = m_PlayerScores.find(Source->GetGUID());
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
if(itr == m_PlayerScores.end()) // player not found...
return;

View file

@ -42,7 +42,7 @@ class BattleGroundRB : public BattleGround
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr,uint64 guid);
void RemovePlayer(Player *plr, ObjectGuid guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
//bool SetupBattleGround();

View file

@ -67,13 +67,13 @@ void BattleGroundRL::AddPlayer(Player *plr)
//create score and add it to map, default values are set in constructor
BattleGroundRLScore* sc = new BattleGroundRLScore;
m_PlayerScores[plr->GetGUID()] = sc;
m_PlayerScores[plr->GetObjectGuid()] = sc;
UpdateWorldState(0xbb8, GetAlivePlayersCountByTeam(ALLIANCE));
UpdateWorldState(0xbb9, GetAlivePlayersCountByTeam(HORDE));
}
void BattleGroundRL::RemovePlayer(Player* /*plr*/, uint64 /*guid*/)
void BattleGroundRL::RemovePlayer(Player* /*plr*/, ObjectGuid /*guid*/)
{
if (GetStatus() == STATUS_WAIT_LEAVE)
return;

View file

@ -44,7 +44,7 @@ class BattleGroundRL : public BattleGround
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid);
void RemovePlayer(Player *plr, ObjectGuid guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleGround();
void HandleKillPlayer(Player* player, Player *killer);

View file

@ -59,10 +59,10 @@ void BattleGroundRV::AddPlayer(Player *plr)
//create score and add it to map, default values are set in constructor
BattleGroundRVScore* sc = new BattleGroundRVScore;
m_PlayerScores[plr->GetGUID()] = sc;
m_PlayerScores[plr->GetObjectGuid()] = sc;
}
void BattleGroundRV::RemovePlayer(Player * /*plr*/, uint64 /*guid*/)
void BattleGroundRV::RemovePlayer(Player * /*plr*/, ObjectGuid /*guid*/)
{
}

View file

@ -42,7 +42,7 @@ class BattleGroundRV : public BattleGround
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr, uint64 guid);
void RemovePlayer(Player *plr, ObjectGuid guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
bool SetupBattleGround();
void HandleKillPlayer(Player* player, Player *killer);

View file

@ -54,10 +54,10 @@ void BattleGroundSA::AddPlayer(Player *plr)
//create score and add it to map, default values are set in constructor
BattleGroundSAScore* sc = new BattleGroundSAScore;
m_PlayerScores[plr->GetGUID()] = sc;
m_PlayerScores[plr->GetObjectGuid()] = sc;
}
void BattleGroundSA::RemovePlayer(Player* /*plr*/,uint64 /*guid*/)
void BattleGroundSA::RemovePlayer(Player* /*plr*/, ObjectGuid /*guid*/)
{
}
@ -72,7 +72,7 @@ void BattleGroundSA::HandleAreaTrigger(Player * /*Source*/, uint32 /*Trigger*/)
void BattleGroundSA::UpdatePlayerScore(Player* Source, uint32 type, uint32 value)
{
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
if(itr == m_PlayerScores.end()) // player not found...
return;

View file

@ -42,7 +42,7 @@ class BattleGroundSA : public BattleGround
virtual void StartingEventCloseDoors();
virtual void StartingEventOpenDoors();
void RemovePlayer(Player *plr,uint64 guid);
void RemovePlayer(Player *plr, ObjectGuid guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
//bool SetupBattleGround();

View file

@ -135,7 +135,7 @@ void BattleGroundWS::AddPlayer(Player *plr)
//create score and add it to map, default values are set in constructor
BattleGroundWGScore* sc = new BattleGroundWGScore;
m_PlayerScores[plr->GetGUID()] = sc;
m_PlayerScores[plr->GetObjectGuid()] = sc;
}
void BattleGroundWS::RespawnFlag(Team team, bool captured)
@ -199,7 +199,7 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
{
if (!IsHordeFlagPickedup())
return;
SetHordeFlagPicker(0); // must be before aura remove to prevent 2 events (drop+capture) at the same time
ClearHordeFlagPicker(); // must be before aura remove to prevent 2 events (drop+capture) at the same time
// horde flag in base (but not respawned yet)
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_WAIT_RESPAWN;
// Drop Horde Flag from Player
@ -213,7 +213,7 @@ void BattleGroundWS::EventPlayerCapturedFlag(Player *Source)
{
if (!IsAllianceFlagPickedup())
return;
SetAllianceFlagPicker(0); // must be before aura remove to prevent 2 events (drop+capture) at the same time
ClearAllianceFlagPicker(); // must be before aura remove to prevent 2 events (drop+capture) at the same time
// alliance flag in base (but not respawned yet)
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_WAIT_RESPAWN;
// Drop Alliance Flag from Player
@ -269,21 +269,21 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
// just take off the aura
if (Source->GetTeam() == ALLIANCE)
{
if (!this->IsHordeFlagPickedup())
if (!IsHordeFlagPickedup())
return;
if (GetHordeFlagPickerGUID() == Source->GetGUID())
if (GetHordeFlagPickerGuid() == Source->GetObjectGuid())
{
SetHordeFlagPicker(0);
ClearHordeFlagPicker();
Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
}
}
else
{
if (!this->IsAllianceFlagPickedup())
if (!IsAllianceFlagPickedup())
return;
if (GetAllianceFlagPickerGUID() == Source->GetGUID())
if (GetAllianceFlagPickerGuid() == Source->GetObjectGuid())
{
SetAllianceFlagPicker(0);
ClearAllianceFlagPicker();
Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
}
}
@ -296,9 +296,9 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
{
if (!IsHordeFlagPickedup())
return;
if (GetHordeFlagPickerGUID() == Source->GetGUID())
if (GetHordeFlagPickerGuid() == Source->GetObjectGuid())
{
SetHordeFlagPicker(0);
ClearHordeFlagPicker();
Source->RemoveAurasDueToSpell(BG_WS_SPELL_WARSONG_FLAG);
m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_GROUND;
Source->CastSpell(Source, BG_WS_SPELL_WARSONG_FLAG_DROPPED, true);
@ -309,9 +309,9 @@ void BattleGroundWS::EventPlayerDroppedFlag(Player *Source)
{
if (!IsAllianceFlagPickedup())
return;
if (GetAllianceFlagPickerGUID() == Source->GetGUID())
if (GetAllianceFlagPickerGuid() == Source->GetObjectGuid())
{
SetAllianceFlagPicker(0);
ClearAllianceFlagPicker();
Source->RemoveAurasDueToSpell(BG_WS_SPELL_SILVERWING_FLAG);
m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_GROUND;
Source->CastSpell(Source, BG_WS_SPELL_SILVERWING_FLAG_DROPPED, true);
@ -444,7 +444,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, ObjectGuid guid)
{
// sometimes flag aura not removed :(
if (IsAllianceFlagPickedup() && m_FlagKeepers[BG_TEAM_ALLIANCE] == guid)
@ -452,7 +452,7 @@ void BattleGroundWS::RemovePlayer(Player *plr, uint64 guid)
if (!plr)
{
sLog.outError("BattleGroundWS: Removing offline player who has the FLAG!!");
SetAllianceFlagPicker(0);
ClearAllianceFlagPicker();
RespawnFlag(ALLIANCE, false);
}
else
@ -463,7 +463,7 @@ void BattleGroundWS::RemovePlayer(Player *plr, uint64 guid)
if (!plr)
{
sLog.outError("BattleGroundWS: Removing offline player who has the FLAG!!");
SetHordeFlagPicker(0);
ClearHordeFlagPicker();
RespawnFlag(HORDE, false);
}
else
@ -506,12 +506,12 @@ void BattleGroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger)
break;
case 3646: // Alliance Flag spawn
if (m_FlagState[BG_TEAM_HORDE] && !m_FlagState[BG_TEAM_ALLIANCE])
if (GetHordeFlagPickerGUID() == Source->GetGUID())
if (GetHordeFlagPickerGuid() == Source->GetObjectGuid())
EventPlayerCapturedFlag(Source);
break;
case 3647: // Horde Flag spawn
if (m_FlagState[BG_TEAM_ALLIANCE] && !m_FlagState[BG_TEAM_HORDE])
if (GetAllianceFlagPickerGUID() == Source->GetGUID())
if (GetAllianceFlagPickerGuid() == Source->GetObjectGuid())
EventPlayerCapturedFlag(Source);
break;
case 3649: // unk1
@ -544,7 +544,7 @@ void BattleGroundWS::Reset()
for(uint32 i = 0; i < BG_TEAMS_COUNT; ++i)
{
m_DroppedFlagGUID[i] = 0;
m_FlagKeepers[i] = 0;
m_FlagKeepers[i].Clear();
m_FlagState[i] = BG_WS_FLAG_STATE_ON_BASE;
m_TeamScores[i] = 0;
}
@ -584,7 +584,7 @@ void BattleGroundWS::HandleKillPlayer(Player *player, Player *killer)
void BattleGroundWS::UpdatePlayerScore(Player *Source, uint32 type, uint32 value)
{
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetGUID());
BattleGroundScoreMap::iterator itr = m_PlayerScores.find(Source->GetObjectGuid());
if(itr == m_PlayerScores.end()) // player not found
return;

View file

@ -109,12 +109,14 @@ class BattleGroundWS : public BattleGround
virtual void StartingEventOpenDoors();
/* BG Flags */
uint64 GetAllianceFlagPickerGUID() const { return m_FlagKeepers[BG_TEAM_ALLIANCE]; }
uint64 GetHordeFlagPickerGUID() const { return m_FlagKeepers[BG_TEAM_HORDE]; }
void SetAllianceFlagPicker(uint64 guid) { m_FlagKeepers[BG_TEAM_ALLIANCE] = guid; }
void SetHordeFlagPicker(uint64 guid) { m_FlagKeepers[BG_TEAM_HORDE] = guid; }
bool IsAllianceFlagPickedup() const { return m_FlagKeepers[BG_TEAM_ALLIANCE] != 0; }
bool IsHordeFlagPickedup() const { return m_FlagKeepers[BG_TEAM_HORDE] != 0; }
ObjectGuid GetAllianceFlagPickerGuid() const{ return m_FlagKeepers[BG_TEAM_ALLIANCE]; }
ObjectGuid GetHordeFlagPickerGuid() const { return m_FlagKeepers[BG_TEAM_HORDE]; }
void SetAllianceFlagPicker(ObjectGuid guid) { m_FlagKeepers[BG_TEAM_ALLIANCE] = guid; }
void SetHordeFlagPicker(ObjectGuid guid) { m_FlagKeepers[BG_TEAM_HORDE] = guid; }
void ClearAllianceFlagPicker() { m_FlagKeepers[BG_TEAM_ALLIANCE].Clear(); }
void ClearHordeFlagPicker() { m_FlagKeepers[BG_TEAM_HORDE].Clear(); }
bool IsAllianceFlagPickedup() const { return !m_FlagKeepers[BG_TEAM_ALLIANCE].IsEmpty(); }
bool IsHordeFlagPickedup() const { return !m_FlagKeepers[BG_TEAM_HORDE].IsEmpty(); }
void RespawnFlag(Team team, bool captured);
void RespawnFlagAfterDrop(Team team);
uint8 GetFlagState(Team team) { return m_FlagState[GetTeamIndexByTeamId(team)]; }
@ -124,7 +126,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, ObjectGuid guid);
void HandleAreaTrigger(Player *Source, uint32 Trigger);
void HandleKillPlayer(Player *player, Player *killer);
bool SetupBattleGround();
@ -146,7 +148,7 @@ class BattleGroundWS : public BattleGround
void SetTeamPoint(Team team, uint32 Points = 0) { m_TeamScores[GetTeamIndexByTeamId(team)] = Points; }
void RemovePoint(Team team, uint32 Points = 1) { m_TeamScores[GetTeamIndexByTeamId(team)] -= Points; }
private:
uint64 m_FlagKeepers[BG_TEAMS_COUNT];
ObjectGuid m_FlagKeepers[BG_TEAMS_COUNT];
uint64 m_DroppedFlagGUID[BG_TEAMS_COUNT];
uint8 m_FlagState[BG_TEAMS_COUNT];

View file

@ -15249,7 +15249,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
{
BattleGround *currentBg = sBattleGroundMgr.GetBattleGround(m_bgData.bgInstanceID, BATTLEGROUND_TYPE_NONE);
bool player_at_bg = currentBg && currentBg->IsPlayerInBattleGround(GetGUID());
bool player_at_bg = currentBg && currentBg->IsPlayerInBattleGround(GetObjectGuid());
if(player_at_bg && currentBg->GetStatus() != STATUS_WAIT_LEAVE)
{
@ -15259,7 +15259,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
m_bgData.bgTypeID = currentBg->GetTypeID();
//join player to battleground group
currentBg->EventPlayerLoggedIn(this, GetGUID());
currentBg->EventPlayerLoggedIn(this, GetObjectGuid());
currentBg->AddOrSetPlayerToCorrectBgGroup(this, GetObjectGuid(), m_bgData.bgTeam);
SetInviteForBattleGroundQueueType(bgQueueTypeId,currentBg->GetInstanceID());
@ -15268,7 +15268,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
{
// leave bg
if (player_at_bg)
currentBg->RemovePlayerAtLeave(GetGUID(), false, true);
currentBg->RemovePlayerAtLeave(GetObjectGuid(), false, true);
// move to bg enter point
const WorldLocation& _loc = GetBattleGroundEntryPoint();
@ -19300,7 +19300,7 @@ void Player::LeaveBattleground(bool teleportToEntryPoint)
{
if(BattleGround *bg = GetBattleGround())
{
bg->RemovePlayerAtLeave(GetGUID(), teleportToEntryPoint, true);
bg->RemovePlayerAtLeave(GetObjectGuid(), teleportToEntryPoint, true);
// call after remove to be sure that player resurrected for correct cast
if( bg->isBattleGround() && !isGameMaster() && sWorld.getConfig(CONFIG_BOOL_BATTLEGROUND_CAST_DESERTER) )

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10799"
#define REVISION_NR "10800"
#endif // __REVISION_NR_H__