From 12fb879e1a6bfe03f2c2c66f0705573ca42831f5 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 6 Feb 2026 20:49:17 -0800 Subject: [PATCH] Fix stale player model persisting across logins by clearing character state on logout --- src/core/application.cpp | 5 +++++ src/game/game_handler.cpp | 1 + 2 files changed, 6 insertions(+) diff --git a/src/core/application.cpp b/src/core/application.cpp index 085e0261..41f6a776 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -397,8 +397,13 @@ void Application::logoutToLogin() { } singlePlayerMode = false; npcsSpawned = false; + playerCharacterSpawned = false; world.reset(); if (renderer) { + // Remove old player model so it doesn't persist into next session + if (auto* charRenderer = renderer->getCharacterRenderer()) { + charRenderer->removeInstance(1); + } if (auto* music = renderer->getMusicManager()) { music->stopMusic(0.0f); } diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index a2249436..105873c9 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -805,6 +805,7 @@ void GameHandler::disconnect() { socket->disconnect(); socket.reset(); } + activeCharacterGuid_ = 0; setState(WorldState::DISCONNECTED); LOG_INFO("Disconnected from world server"); }