From cebee1621e8620e7171b7b72cf0aadc238c33a48 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 14 Jan 2021 11:18:21 -0500 Subject: [PATCH] Core/Commands: Fixes adding new creatures and gameobjects using in-game commands --- Source/Game/Entities/GameObject/GameObject.cs | 2 +- Source/Game/Entities/Player/Player.cs | 2 +- Source/Game/Maps/SpawnData.cs | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Source/Game/Entities/GameObject/GameObject.cs b/Source/Game/Entities/GameObject/GameObject.cs index 1095eaf28..9f94f4a4a 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 = new WorldLocation(this); + data.spawnPoint.WorldRelocate(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 42547edcf..9cf44597b 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 = new WorldLocation(caster); + _resurrectionData.Location.WorldRelocate(caster); _resurrectionData.Health = health; _resurrectionData.Mana = mana; _resurrectionData.Aura = appliedAura; diff --git a/Source/Game/Maps/SpawnData.cs b/Source/Game/Maps/SpawnData.cs index cfa9ef586..1511bf603 100644 --- a/Source/Game/Maps/SpawnData.cs +++ b/Source/Game/Maps/SpawnData.cs @@ -38,16 +38,20 @@ namespace Game.Maps public PhaseUseFlagsValues phaseUseFlags; public uint phaseId; public uint phaseGroup; - public int terrainSwapMap = -1; + public int terrainSwapMap; public int spawntimesecs; public List spawnDifficulties; public SpawnGroupTemplateData spawnGroupData; public uint ScriptId; - public bool dbData = true; + public bool dbData; public SpawnData(SpawnObjectType t) { type = t; + spawnPoint = new WorldLocation(); + terrainSwapMap = -1; + spawnDifficulties = new List(); + dbData = true; } } }