mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Commands: Fixed creature/gameobject move commands not updating which cell they belong to
Closes #22720
(cherry picked from commit ec1cfa36f4)
This commit is contained in:
@@ -497,7 +497,11 @@ public:
|
||||
Map* map = object->GetMap();
|
||||
|
||||
object->Relocate(x, y, z, object->GetOrientation());
|
||||
|
||||
// update which cell has this gameobject registered for loading
|
||||
sObjectMgr->RemoveGameobjectFromGrid(guidLow, object->GetGameObjectData());
|
||||
object->SaveToDB();
|
||||
sObjectMgr->AddGameobjectToGrid(guidLow, object->GetGameObjectData());
|
||||
|
||||
// Generate a completely new spawn with new guid
|
||||
// 3.3.5a client caches recently deleted objects and brings them back to life
|
||||
|
||||
@@ -819,7 +819,9 @@ public:
|
||||
}
|
||||
|
||||
// update position in memory
|
||||
sObjectMgr->RemoveCreatureFromGrid(lowguid, data);
|
||||
const_cast<CreatureData*>(data)->spawnPoint.Relocate(*player);
|
||||
sObjectMgr->AddCreatureToGrid(lowguid, data);
|
||||
|
||||
// update position in DB
|
||||
WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_POSITION);
|
||||
|
||||
Reference in New Issue
Block a user