From 0f1cbbb5021f046d0959791096542f189ce98830 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sat, 25 Apr 2020 00:23:26 -0400 Subject: [PATCH] Core/Entities: Fixed saving spawn difficulties to db for .npc add and .gob add (and other commands that modify creature/gameobject spawns table) Port From (https://github.com/TrinityCore/TrinityCore/commit/5526e14bcf1efe7a4b1f96760a1816d2e0e1c1b9) --- Source/Game/Entities/Creature/Creature.cs | 2 +- Source/Game/Entities/GameObject/GameObject.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index 5727ebfc2..b149a9f38 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -1084,7 +1084,7 @@ namespace Game.Entities stmt.AddValue(index++, m_spawnId); stmt.AddValue(index++, GetEntry()); stmt.AddValue(index++, mapid); - stmt.AddValue(index++, string.Join(",", data.spawnDifficulties)); + stmt.AddValue(index++, data.spawnDifficulties.Empty() ? "" : string.Join(',', data.spawnDifficulties)); stmt.AddValue(index++, data.phaseId); stmt.AddValue(index++, data.phaseGroup); stmt.AddValue(index++, displayId); diff --git a/Source/Game/Entities/GameObject/GameObject.cs b/Source/Game/Entities/GameObject/GameObject.cs index 41655d9ef..2ba6607bc 100644 --- a/Source/Game/Entities/GameObject/GameObject.cs +++ b/Source/Game/Entities/GameObject/GameObject.cs @@ -942,7 +942,7 @@ namespace Game.Entities stmt.AddValue(index++, m_spawnId); stmt.AddValue(index++, GetEntry()); stmt.AddValue(index++, mapid); - stmt.AddValue(index++, string.Join(",", data.spawnDifficulties)); + stmt.AddValue(index++, data.spawnDifficulties.Empty() ? "" : string.Join(",", data.spawnDifficulties)); stmt.AddValue(index++, data.phaseId); stmt.AddValue(index++, data.phaseGroup); stmt.AddValue(index++, GetPositionX());