diff --git a/Source/Game/Chat/Commands/GameObjectCommands.cs b/Source/Game/Chat/Commands/GameObjectCommands.cs index 54d6b8927..3d12faf21 100644 --- a/Source/Game/Chat/Commands/GameObjectCommands.cs +++ b/Source/Game/Chat/Commands/GameObjectCommands.cs @@ -72,6 +72,9 @@ namespace Game.Chat if (!ulong.TryParse(id, out ulong guidLow) || guidLow == 0) return false; + Player player = handler.GetSession().GetPlayer(); + // force respawn to make sure we find something + player.GetMap().RemoveRespawnTime(SpawnObjectType.GameObject, guidLow, true); GameObject obj = handler.GetObjectFromPlayerMapByDbGuid(guidLow); if (!obj) { @@ -82,7 +85,7 @@ namespace Game.Chat ObjectGuid ownerGuid = obj.GetOwnerGUID(); if (ownerGuid.IsEmpty()) { - Unit owner = Global.ObjAccessor.GetUnit(handler.GetPlayer(), ownerGuid); + Unit owner = Global.ObjAccessor.GetUnit(player, ownerGuid); if (!owner || !ownerGuid.IsPlayer()) { handler.SendSysMessage(CypherStrings.CommandDelobjrefercreature, ownerGuid.ToString(), obj.GetGUID().ToString()); diff --git a/Source/Game/Chat/Commands/NPCCommands.cs b/Source/Game/Chat/Commands/NPCCommands.cs index 074c9ca99..d557563b5 100644 --- a/Source/Game/Chat/Commands/NPCCommands.cs +++ b/Source/Game/Chat/Commands/NPCCommands.cs @@ -879,6 +879,9 @@ namespace Game.Chat if (!ulong.TryParse(cId, out ulong guidLow) || guidLow == 0) return false; + // force respawn to make sure we find something + handler.GetSession().GetPlayer().GetMap().RemoveRespawnTime(SpawnObjectType.Creature, guidLow, true); + // then try to find it creature = handler.GetCreatureFromPlayerMapByDbGuid(guidLow); } else