*Fix a crash by looting player's corpse when the bg is unloaded.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-18 17:44:17 -05:00
parent 0ca7275043
commit cfd24129d3
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -1107,6 +1107,7 @@ void Map::RemoveAllPlayers()
{
if(HavePlayers())
{
// this is happening for bg
sLog.outError("Map::UnloadAll: there are still players in the instance at unload, should not happen!");
for(MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
+2 -1
View File
@@ -7818,7 +7818,8 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
bones->lootForBody = true;
uint32 pLevel = bones->loot.gold;
bones->loot.clear();
if(GetBattleGround()->GetTypeID() == BATTLEGROUND_AV)
if(BattleGround *bg = GetBattleGround())
if(bg->GetTypeID() == BATTLEGROUND_AV)
loot->FillLoot(1, LootTemplates_Creature, this, true);
// It may need a better formula
// Now it works like this: lvl10: ~6copper, lvl70: ~9silver