From 36554bf1f37ce8d517c3ee02fc07afc05c773062 Mon Sep 17 00:00:00 2001 From: Lucy <44952533+Skyliegirl33@users.noreply.github.com> Date: Thu, 19 Jan 2023 02:23:39 +0100 Subject: [PATCH] Fix player not being removed upon leaving territory (cherry picked from commit 1713523e197a225fc5ff5c61a7143dcec091ad59) --- src/world/Territory/Territory.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/world/Territory/Territory.cpp b/src/world/Territory/Territory.cpp index c2a0c938..2012b6ed 100644 --- a/src/world/Territory/Territory.cpp +++ b/src/world/Territory/Territory.cpp @@ -490,7 +490,8 @@ void Territory::updateSessions( uint64_t tickCount, bool changedWeather ) } // this session is not linked to this area anymore, remove it from zone session list - if( pPlayer->getTerritoryId() != m_guId ) + // TODO: Retrieving the session is expensive, try to find a better method of removing invalid actors + if( pPlayer->getTerritoryId() != m_guId || !server.getSession( pPlayer->getId() ) ) { Logger::debug( "[{}] removeActor( pPlayer );", pPlayer->getId() ); removeActor( pPlayer );