From 46ce78aa4506c7c8163c1b6d7ce9bb94d137c20f Mon Sep 17 00:00:00 2001 From: collett Date: Sat, 11 Sep 2021 00:52:59 +0900 Subject: [PATCH] Correctly removes players from their cells when leaving zone, fixes mob-in-city problem. --- src/world/Territory/Territory.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/world/Territory/Territory.cpp b/src/world/Territory/Territory.cpp index fe14175b..d3d78dcb 100644 --- a/src/world/Territory/Territory.cpp +++ b/src/world/Territory/Territory.cpp @@ -269,12 +269,7 @@ void Sapphire::Territory::pushActor( Entity::ActorPtr pActor ) void Sapphire::Territory::removeActor( Entity::ActorPtr pActor ) { - float mx = pActor->getPos().x; - float my = pActor->getPos().z; - uint32_t cx = getPosX( mx ); - uint32_t cy = getPosY( my ); - - Cell* pCell = getCellPtr( cx, cy ); + Cell* pCell = pActor->getCellPtr(); if( pCell && pCell->hasActor( pActor ) ) pCell->removeActorFromCell( pActor );