[7841] Fixed: Prevent loading maps/vmaps when building enum. Author: SilverIce

--HG--
branch : trunk
This commit is contained in:
megamage committed 2009-05-17 18:41:16 -05:00
1 parent 3d43b9a612
commit ce0feb36ea
2 files changed
+24 -20

No files matched your search

+20 -16
View File
@@ -1471,8 +1471,8 @@ void Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
*p_data << uint8(getLevel()); // player level
// do not use GetMap! it will spawn a new instance since the bound instances are not loaded
uint32 zoneId = MapManager::Instance().GetZoneId(GetMapId(), GetPositionX(),GetPositionY(),GetPositionZ());
sLog.outDebug("Player::BuildEnumData: m:%u, x:%f, y:%f, z:%f zone:%u", GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), zoneId);
uint32 zoneId = fields[10].GetUInt32();
sLog.outDebug("Player::BuildEnumData: map:%u, x:%f, y:%f, z:%f zone:%u", GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), zoneId);
*p_data << uint32(zoneId);
*p_data << uint32(GetMapId());
@@ -1481,7 +1481,7 @@ void Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
*p_data << GetPositionZ();
// guild id
*p_data << (result ? fields[13].GetUInt32() : 0);
*p_data << uint32(fields[14].GetUInt32());
uint32 char_flags = 0;
if(HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_HELM))
@@ -1494,7 +1494,7 @@ void Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
char_flags |= CHARACTER_FLAG_RENAME;
if(sWorld.getConfig(CONFIG_DECLINED_NAMES_USED))
{
if(!fields[14].GetCppString().empty())
if(!fields[15].GetCppString().empty())
char_flags |= CHARACTER_FLAG_DECLINED;
}
else
@@ -1514,12 +1514,12 @@ void Player::BuildEnumData( QueryResult * result, WorldPacket * p_data )
// show pet at selection character in character list only for non-ghost character
if (result && isAlive() && (pClass == CLASS_WARLOCK || pClass == CLASS_HUNTER || pClass == CLASS_DEATH_KNIGHT))
{
uint32 entry = fields[10].GetUInt32();
uint32 entry = fields[11].GetUInt32();
CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(entry);
if(cInfo)
{
petDisplayId = fields[11].GetUInt32();
petLevel = fields[12].GetUInt32();
petDisplayId = fields[12].GetUInt32();
petLevel = fields[13].GetUInt32();
petFamily = cInfo->family;
}
}
@@ -13988,20 +13988,23 @@ void Player::SendQuestUpdateAddCreatureOrGo( Quest const* pQuest, uint64 guid, u
bool Player::MinimalLoadFromDB( QueryResult *result, uint32 guid )
{
bool delete_result = true;
if(!result)
if (!result)
{
// 0 1 2 3 4 5 6 7 8 9
result = CharacterDatabase.PQuery("SELECT guid, data, name, position_x, position_y, position_z, map, totaltime, leveltime, at_login FROM characters WHERE guid = '%u'",guid);
if(!result) return false;
// 0 1 2 3 4 5 6 7 8 9 10
result = CharacterDatabase.PQuery("SELECT guid, data, name, position_x, position_y, position_z, map, totaltime, leveltime, at_login, zone FROM characters WHERE guid = '%u'",guid);
if (!result)
return false;
}
else delete_result = false;
else
delete_result = false;
Field *fields = result->Fetch();
if(!LoadValues( fields[1].GetString()))
if (!LoadValues( fields[1].GetString()))
{
sLog.outError("Player #%d have broken data in `data` field. Can't be loaded for character list.",GUID_LOPART(guid));
if(delete_result) delete result;
if (delete_result)
delete result;
return false;
}
@@ -14024,12 +14027,13 @@ bool Player::MinimalLoadFromDB( QueryResult *result, uint32 guid )
_LoadBoundInstances();*/
if (delete_result) delete result;
if (delete_result)
delete result;
for (int i = 0; i < PLAYER_SLOTS_COUNT; i++)
m_items[i] = NULL;
if( HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST) )
if (HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
m_deathState = DEAD;
return true;