*Fix a crash by looting player's corpse when the bg is unloaded.
--HG-- branch : trunk
This commit is contained in:
@@ -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)
|
||||
|
||||
+3
-2
@@ -7818,8 +7818,9 @@ void Player::SendLoot(uint64 guid, LootType loot_type)
|
||||
bones->lootForBody = true;
|
||||
uint32 pLevel = bones->loot.gold;
|
||||
bones->loot.clear();
|
||||
if(GetBattleGround()->GetTypeID() == BATTLEGROUND_AV)
|
||||
loot->FillLoot(1, LootTemplates_Creature, this, true);
|
||||
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
|
||||
bones->loot.gold = (uint32)( urand(50, 150) * 0.016f * pow( ((float)pLevel)/5.76f, 2.5f) * sWorld.getRate(RATE_DROP_MONEY) );
|
||||
|
||||
Reference in New Issue
Block a user