From a3c15332650753931ec293ae3a9e3cf3c2f0ecd2 Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Sun, 23 Feb 2025 13:12:30 -0500 Subject: [PATCH] Core/Quests: Use a helper function for quest objective StorageIndex startup validation Port From (https://github.com/TrinityCore/TrinityCore/commit/5df1c6dea68efcbb5c739f459c7cbbda4d6984b5) --- Source/Game/Globals/ObjectManager.cs | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/Source/Game/Globals/ObjectManager.cs b/Source/Game/Globals/ObjectManager.cs index a1417c978..b338eb5f8 100644 --- a/Source/Game/Globals/ObjectManager.cs +++ b/Source/Game/Globals/ObjectManager.cs @@ -7659,24 +7659,8 @@ namespace Game _questObjectives[obj.Id] = obj; // Check storage index for objectives which store data - if (obj.StorageIndex < 0) - { - switch (obj.Type) - { - case QuestObjectiveType.Monster: - case QuestObjectiveType.Item: - case QuestObjectiveType.GameObject: - case QuestObjectiveType.TalkTo: - case QuestObjectiveType.PlayerKills: - case QuestObjectiveType.AreaTrigger: - case QuestObjectiveType.WinPetBattleAgainstNpc: - case QuestObjectiveType.ObtainCurrency: - Log.outError(LogFilter.Sql, "Quest {0} objective {1} has invalid StorageIndex = {2} for objective type {3}", qinfo.Id, obj.Id, obj.StorageIndex, obj.Type); - break; - default: - break; - } - } + if (obj.IsStoringValue() && obj.StorageIndex < 0) + Log.outError(LogFilter.Sql, $"Quest {qinfo.Id} objective {obj.Id} has invalid StorageIndex = {obj.StorageIndex} for objective type {obj.Type}"); switch (obj.Type) {