From 5ea0f1e468d9863f88bf06508890415c57890c86 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 30 May 2022 13:42:39 -0400 Subject: [PATCH] Core/SAI: Remove reactState param from SMART_ACTION_WP_START Port From (https://github.com/TrinityCore/TrinityCore/commit/ebcd45b7e1eaa07386a3927d73575339535ec557) --- Source/Framework/Constants/SmartAIConst.cs | 2 +- Source/Game/AI/SmartScripts/SmartAIManager.cs | 12 +----------- Source/Game/AI/SmartScripts/SmartScript.cs | 3 --- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/Source/Framework/Constants/SmartAIConst.cs b/Source/Framework/Constants/SmartAIConst.cs index 3c8aaa318..f53e6052f 100644 --- a/Source/Framework/Constants/SmartAIConst.cs +++ b/Source/Framework/Constants/SmartAIConst.cs @@ -296,7 +296,7 @@ namespace Framework.Constants SummonGo = 50, // Gameobjectid, Despawntime In Ms, KillUnit = 51, // ActivateTaxi = 52, // Taxiid - WpStart = 53, // Run/Walk, Pathid, Canrepeat, Quest, Despawntime, Reactstate + WpStart = 53, // Run/Walk, Pathid, Canrepeat, Quest, Despawntime WpPause = 54, // Time WpStop = 55, // Despawntime, Quest, Fail? AddItem = 56, // Itemid, Count diff --git a/Source/Game/AI/SmartScripts/SmartAIManager.cs b/Source/Game/AI/SmartScripts/SmartAIManager.cs index 6a221a882..ea448e167 100644 --- a/Source/Game/AI/SmartScripts/SmartAIManager.cs +++ b/Source/Game/AI/SmartScripts/SmartAIManager.cs @@ -1673,16 +1673,6 @@ namespace Game.AI if (e.Action.wpStart.quest != 0 && !IsQuestValid(e, e.Action.wpStart.quest)) return false; - // Allow "invalid" value 3 for a while to allow cleanup the values stored in the db for SMART_ACTION_WP_START. - // Remember to remove this once the clean is complete. - int TEMPORARY_EXTRA_VALUE_FOR_DB_CLEANUP = 1; - - if (e.Action.wpStart.reactState > (uint)(ReactStates.Aggressive + TEMPORARY_EXTRA_VALUE_FOR_DB_CLEANUP)) - { - Log.outError(LogFilter.ScriptsAi, $"SmartAIMgr: {e} uses invalid React State {e.Action.wpStart.reactState}, skipped."); - return false; - } - TC_SAI_IS_BOOLEAN_VALID(e, e.Action.wpStart.run); TC_SAI_IS_BOOLEAN_VALID(e, e.Action.wpStart.repeat); break; @@ -3464,7 +3454,7 @@ namespace Game.AI public uint repeat; public uint quest; public uint despawnTime; - public uint reactState; + //public uint reactState; DO NOT REUSE } public struct WpPause { diff --git a/Source/Game/AI/SmartScripts/SmartScript.cs b/Source/Game/AI/SmartScripts/SmartScript.cs index 2b4f7bc54..f262f98a6 100644 --- a/Source/Game/AI/SmartScripts/SmartScript.cs +++ b/Source/Game/AI/SmartScripts/SmartScript.cs @@ -1332,9 +1332,6 @@ namespace Game.AI } } - // Extra validation to ignore invalid values stored in the db, see comment at TEMPORARY_EXTRA_VALUE_FOR_DB_CLEANUP definition - if ((ReactStates)e.Action.wpStart.reactState <= ReactStates.Aggressive) - _me.SetReactState((ReactStates)e.Action.wpStart.reactState); _me.GetAI().StartPath(run, entry, repeat, unit); uint quest = e.Action.wpStart.quest;