Skip to content

Commit 2e1b1b8

Browse files
committed
Core/Players: Fixed deleting characters, remove CharacterNameData only after the character is deleted, not before
1 parent 48dbccc commit 2e1b1b8

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

src/server/game/Entities/Player/Player.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5013,10 +5013,13 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
50135013
}
50145014
default:
50155015
sLog->outError(LOG_FILTER_PLAYER, "Player::DeleteFromDB: Unsupported delete method: %u.", charDelete_method);
5016+
return;
50165017
}
50175018

50185019
if (updateRealmChars)
50195020
sWorld->UpdateRealmCharCount(accountId);
5021+
5022+
sWorld->DeleteCharacterNameData(GUID_LOPART(guid));
50205023
}
50215024

50225025
/**

src/server/game/Handlers/CharacterHandler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,6 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recvData)
738738
std::string IP_str = GetRemoteAddress();
739739
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);
740740
sScriptMgr->OnPlayerDelete(guid);
741-
sWorld->DeleteCharacterNameData(GUID_LOPART(guid));
742741

743742
if (sLog->ShouldLog(LOG_FILTER_PLAYER_DUMP, LOG_LEVEL_INFO)) // optimize GetPlayerDump call
744743
{

0 commit comments

Comments
 (0)