Core/Commands: Fixed .gobject move and turn

This commit is contained in:
hondacrx
2018-12-24 01:08:29 -05:00
parent 11d2d56ddf
commit 56291f2273
@@ -145,12 +145,21 @@ namespace Game.Chat
}
}
obj.DestroyForNearbyPlayers();
obj.RelocateStationaryPosition(x, y, z, obj.GetOrientation());
obj.GetMap().GameObjectRelocation(obj, x, y, z, obj.GetOrientation());
Map map = obj.GetMap();
obj.Relocate(x, y, z, obj.GetOrientation());
obj.SaveToDB();
// Generate a completely new spawn with new guid
// client caches recently deleted objects and brings them back to life
// when CreateObject block for this guid is received again
// however it entirely skips parsing that block and only uses already known location
obj.Delete();
obj = GameObject.CreateGameObjectFromDB(guidLow, map);
if (!obj)
return false;
handler.SendSysMessage(CypherStrings.CommandMoveobjmessage, obj.GetSpawnId(), obj.GetGoInfo().name, obj.GetGUID().ToString());
return true;
@@ -360,14 +369,22 @@ namespace Game.Chat
oz = player.GetOrientation();
}
obj.Relocate(obj.GetPositionX(), obj.GetPositionY(), obj.GetPositionZ());
obj.RelocateStationaryPosition(obj.GetPositionX(), obj.GetPositionY(), obj.GetPositionZ(), obj.GetOrientation());
obj.SetWorldRotationAngles(oz, oy, ox);
obj.DestroyForNearbyPlayers();
obj.UpdateObjectVisibility();
Map map = obj.GetMap();
obj.Relocate(obj.GetPositionX(), obj.GetPositionY(), obj.GetPositionZ());
obj.SetWorldRotationAngles(oz, oy, ox);
obj.SaveToDB();
// Generate a completely new spawn with new guid
// client caches recently deleted objects and brings them back to life
// when CreateObject block for this guid is received again
// however it entirely skips parsing that block and only uses already known location
obj.Delete();
obj = GameObject.CreateGameObjectFromDB(guidLow, map);
if (!obj)
return false;
handler.SendSysMessage(CypherStrings.CommandTurnobjmessage, obj.GetSpawnId(), obj.GetGoInfo().name, obj.GetGUID().ToString(), obj.GetOrientation());
return true;