From 2e1b1b8ceb08dcbe35f11605486c45f52717f2e2 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 29 Apr 2013 15:29:51 +0200 Subject: Core/Players: Fixed deleting characters, remove CharacterNameData only after the character is deleted, not before --- src/server/game/Entities/Player/Player.cpp | 3 +++ src/server/game/Handlers/CharacterHandler.cpp | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index b8e1233593b..2b39045e1e7 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -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)); } /** diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index f1ec017962e..3e27157ed66 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -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 { -- cgit v1.2.3