Core/Battlegrounds: do not teleport GMs if out of bounds before starting

(cherry picked from commit 80a463bccb4275f77ce5dd6cd4ae33ee2ba90862)
This commit is contained in:
ariel-
2017-02-11 21:09:01 +01:00
committed by joschiwald
parent 5264374fd6
commit 41fad95ad8
@@ -299,8 +299,12 @@ inline void Battleground::_CheckSafePositions(uint32 diff)
m_ValidStartPositionTimer = 0;
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
{
if (Player* player = ObjectAccessor::FindPlayer(itr->first))
{
if (player->IsGameMaster())
continue;
Position pos = player->GetPosition();
Position const* startPos = GetTeamStartPosition(Battleground::GetTeamIndexByTeamId(player->GetBGTeam()));
if (pos.GetExactDistSq(startPos) > maxDist)
@@ -309,6 +313,7 @@ inline void Battleground::_CheckSafePositions(uint32 diff)
player->TeleportTo(GetMapId(), startPos->GetPositionX(), startPos->GetPositionY(), startPos->GetPositionZ(), startPos->GetOrientation());
}
}
}
}
}