Fixied crash at .pinfo command use from console.

Also apply mangos code style to related code.
This commit is contained in:
VladimirMangos 2008-10-30 21:04:51 +03:00
parent a26b72411a
commit 0bf682fdbd
3 changed files with 54 additions and 52 deletions

View file

@ -1794,7 +1794,8 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
else
{
accId = objmgr.GetPlayerAccountIdByGUID(targetGUID);
Player plr(m_session); // use current session for temporary load
WorldSession session(0,NULL,SEC_PLAYER,0,0,LOCALE_enUS);
Player plr(&session); // use fake session for temporary load
plr.MinimalLoadFromDB(NULL, targetGUID);
money = plr.GetMoney();
total_player_time = plr.GetTotalPlayedTime();

View file

@ -2414,7 +2414,10 @@ void World::UpdateSessions( time_t diff )
///- Delete kicked sessions at add new session
for (std::set<WorldSession*>::iterator itr = m_kicked_sessions.begin(); itr != m_kicked_sessions.end(); ++itr)
{
RemoveQueuedPlayer (*itr);
delete *itr;
}
m_kicked_sessions.clear();
///- Then send an update signal to remaining ones

View file

@ -75,8 +75,6 @@ WorldSession::~WorldSession()
WorldPacket *packet = _recvQueue.next ();
delete packet;
}
sWorld.RemoveQueuedPlayer(this);
}
void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const