From 970876df40c70f84c4100c05ee0551cc5cf4c75b Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 11 Jan 2021 17:19:21 -0500 Subject: [PATCH] Fix crash when adding new gameobject with command. --- Source/Game/Entities/GameObject/GameObject.cs | 2 +- Source/Game/Entities/Player/Player.cs | 2 +- Source/Game/Globals/ObjectManager.cs | 1 + Source/Game/Maps/SpawnData.cs | 1 - 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Game/Entities/GameObject/GameObject.cs b/Source/Game/Entities/GameObject/GameObject.cs index 9f94f4a4a..1095eaf28 100644 --- a/Source/Game/Entities/GameObject/GameObject.cs +++ b/Source/Game/Entities/GameObject/GameObject.cs @@ -950,7 +950,7 @@ namespace Game.Entities Cypher.Assert(data.spawnId == m_spawnId); data.Id = GetEntry(); - data.spawnPoint.WorldRelocate(this); + data.spawnPoint = new WorldLocation(this); data.rotation = m_worldRotation; data.spawntimesecs = (int)(m_spawnedByDefault ? m_respawnDelayTime : -m_respawnDelayTime); data.animprogress = GetGoAnimProgress(); diff --git a/Source/Game/Entities/Player/Player.cs b/Source/Game/Entities/Player/Player.cs index 9cf44597b..42547edcf 100644 --- a/Source/Game/Entities/Player/Player.cs +++ b/Source/Game/Entities/Player/Player.cs @@ -3481,7 +3481,7 @@ namespace Game.Entities Cypher.Assert(!IsResurrectRequested()); _resurrectionData = new ResurrectionData(); _resurrectionData.GUID = caster.GetGUID(); - _resurrectionData.Location.WorldRelocate(caster); + _resurrectionData.Location = new WorldLocation(caster); _resurrectionData.Health = health; _resurrectionData.Mana = mana; _resurrectionData.Aura = appliedAura; diff --git a/Source/Game/Globals/ObjectManager.cs b/Source/Game/Globals/ObjectManager.cs index f18d6e291..d3c229358 100644 --- a/Source/Game/Globals/ObjectManager.cs +++ b/Source/Game/Globals/ObjectManager.cs @@ -4401,6 +4401,7 @@ namespace Game { if (!gameObjectDataStorage.ContainsKey(guid)) gameObjectDataStorage[guid] = new GameObjectData(); + return gameObjectDataStorage[guid]; } public GameObjectTemplate GetGameObjectTemplate(uint entry) diff --git a/Source/Game/Maps/SpawnData.cs b/Source/Game/Maps/SpawnData.cs index 60540b084..cfa9ef586 100644 --- a/Source/Game/Maps/SpawnData.cs +++ b/Source/Game/Maps/SpawnData.cs @@ -45,7 +45,6 @@ namespace Game.Maps public uint ScriptId; public bool dbData = true; - public SpawnData(SpawnObjectType t) { type = t;