Core/Players: Fixed deleting characters, remove CharacterNameData only after the character is deleted, not before

This commit is contained in:
Shauren
2013-04-29 15:29:51 +02:00
parent 48dbccc352
commit 2e1b1b8ceb
2 changed files with 3 additions and 1 deletions
@@ -5013,10 +5013,13 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
}
default:
sLog->outError(LOG_FILTER_PLAYER, "Player::DeleteFromDB: Unsupported delete method: %u.", charDelete_method);
return;
}
if (updateRealmChars)
sWorld->UpdateRealmCharCount(accountId);
sWorld->DeleteCharacterNameData(GUID_LOPART(guid));
}
/**
@@ -738,7 +738,6 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recvData)
std::string IP_str = GetRemoteAddress();
sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %d, IP: %s deleted character: %s, GUID: %u, Level: %u", accountId, IP_str.c_str(), name.c_str(), GUID_LOPART(guid), level);
sScriptMgr->OnPlayerDelete(guid);
sWorld->DeleteCharacterNameData(GUID_LOPART(guid));
if (sLog->ShouldLog(LOG_FILTER_PLAYER_DUMP, LOG_LEVEL_INFO)) // optimize GetPlayerDump call
{