aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Commands/cs_gobject.cpp4
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp
index 4a6d3a37c4b..7b3aed3bd43 100644
--- a/src/server/scripts/Commands/cs_gobject.cpp
+++ b/src/server/scripts/Commands/cs_gobject.cpp
@@ -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
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index 0c82ee14b7f..fe1f60033ed 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -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);