feat(Core/Player): delete character cache in Player::DeleteFromDB() (#14388)
This commit is contained in:
@@ -4240,8 +4240,16 @@ void Player::DeleteFromDB(ObjectGuid::LowType lowGuid, uint32 accountId, bool up
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (CharacterCacheEntry const* cache = sCharacterCache->GetCharacterCacheByGuid(playerGuid))
|
||||||
|
{
|
||||||
|
std::string name = cache->Name;
|
||||||
|
sCharacterCache->DeleteCharacterCacheEntry(playerGuid, name);
|
||||||
|
}
|
||||||
|
|
||||||
if (updateRealmChars)
|
if (updateRealmChars)
|
||||||
|
{
|
||||||
sWorld->UpdateRealmCharCount(accountId);
|
sWorld->UpdateRealmCharCount(accountId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -658,7 +658,6 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recvData)
|
|||||||
sCalendarMgr->RemoveAllPlayerEventsAndInvites(guid);
|
sCalendarMgr->RemoveAllPlayerEventsAndInvites(guid);
|
||||||
Player::DeleteFromDB(guid.GetCounter(), GetAccountId(), true, false);
|
Player::DeleteFromDB(guid.GetCounter(), GetAccountId(), true, false);
|
||||||
|
|
||||||
sCharacterCache->DeleteCharacterCacheEntry(guid, name);
|
|
||||||
SendCharDelete(CHAR_DELETE_SUCCESS);
|
SendCharDelete(CHAR_DELETE_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user