mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 03:32:28 -04:00
[svn] * Prevent crash at access to deleted social data for player. Remove social data at logout instead - source mangos
* Fixed subcommands list output at console. - source mangos * Rename scripts update. --HG-- branch : trunk
This commit is contained in:
@@ -795,7 +795,13 @@ bool ChatHandler::ShowHelpForSubCommands(ChatCommand *table, char const* cmd, ch
|
||||
if( *subcmd && !hasStringAbbr(table[i].Name, subcmd))
|
||||
continue;
|
||||
|
||||
(list += "\n ") += table[i].Name;
|
||||
if(m_session)
|
||||
list += "\n ";
|
||||
else
|
||||
list += "\n\r ";
|
||||
|
||||
list += table[i].Name;
|
||||
|
||||
if(table[i].ChildCommands)
|
||||
list += " ...";
|
||||
}
|
||||
|
||||
@@ -433,10 +433,7 @@ Player::~Player ()
|
||||
{
|
||||
CleanupsBeforeDelete();
|
||||
|
||||
if(m_uint32Values) // only for fully created Object
|
||||
{
|
||||
sSocialMgr.RemovePlayerSocial(GetGUIDLow());
|
||||
}
|
||||
//m_social = NULL;
|
||||
|
||||
// Note: buy back item already deleted from DB when player was saved
|
||||
for(int i = 0; i < PLAYER_SLOTS_COUNT; ++i)
|
||||
|
||||
@@ -4898,7 +4898,7 @@ void Spell::EffectDuel(uint32 i)
|
||||
Player *target = (Player*)unitTarget;
|
||||
|
||||
// caster or target already have requested duel
|
||||
if( caster->duel || target->duel || target->GetSocial()->HasIgnore(caster->GetGUIDLow()) )
|
||||
if( caster->duel || target->duel || !target->GetSocial() || target->GetSocial()->HasIgnore(caster->GetGUIDLow()) )
|
||||
return;
|
||||
|
||||
// Players can only fight a duel with each other outside (=not inside dungeons and not in capital cities)
|
||||
|
||||
@@ -385,6 +385,7 @@ void WorldSession::LogoutPlayer(bool Save)
|
||||
///- Delete the player object
|
||||
_player->CleanupsBeforeDelete(); // do some cleanup before deleting to prevent crash at crossreferences to already deleted data
|
||||
|
||||
sSocialMgr.RemovePlayerSocial (_player->GetGUIDLow ());
|
||||
delete _player;
|
||||
_player = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user