mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 21:56:22 +00:00
fix(Core/Character): fix worldserver with autobalance mod crash when character creation fails (#17625)
* set vars before clean player when create err * code style * dont clean * code style * check flag
This commit is contained in:
@@ -537,7 +537,11 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
|
||||
|
||||
std::shared_ptr<Player> newChar(new Player(this), [](Player* ptr)
|
||||
{
|
||||
ptr->CleanupsBeforeDelete();
|
||||
// Only when player is created correctly do clean
|
||||
if (ptr->HasAtLoginFlag(AT_LOGIN_FIRST))
|
||||
{
|
||||
ptr->CleanupsBeforeDelete();
|
||||
}
|
||||
delete ptr;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user