diff --git a/Source/Game/Chat/Commands/GameObjectCommands.cs b/Source/Game/Chat/Commands/GameObjectCommands.cs index 88e9c02df..fd423de69 100644 --- a/Source/Game/Chat/Commands/GameObjectCommands.cs +++ b/Source/Game/Chat/Commands/GameObjectCommands.cs @@ -283,9 +283,12 @@ namespace Game.Chat } Map map = obj.GetMap(); - obj.Relocate(x, y, z, obj.GetOrientation()); + + // update which cell has this gameobject registered for loading + Global.ObjectMgr.RemoveGameObjectFromGrid(guidLow, obj.GetGameObjectData()); obj.SaveToDB(); + Global.ObjectMgr.AddGameObjectToGrid(guidLow, obj.GetGameObjectData()); // Generate a completely new spawn with new guid // client caches recently deleted objects and brings them back to life diff --git a/Source/Game/Chat/Commands/NPCCommands.cs b/Source/Game/Chat/Commands/NPCCommands.cs index c9391b8c4..9774d84d3 100644 --- a/Source/Game/Chat/Commands/NPCCommands.cs +++ b/Source/Game/Chat/Commands/NPCCommands.cs @@ -239,7 +239,9 @@ namespace Game.Chat return false; } + Global.ObjectMgr.RemoveCreatureFromGrid(lowguid, data); data.spawnPoint.Relocate(player); + Global.ObjectMgr.AddCreatureToGrid(lowguid, data); // update position in DB PreparedStatement stmt = DB.World.GetPreparedStatement(WorldStatements.UPD_CREATURE_POSITION);