Core/SAI: Remove reactState param from SMART_ACTION_WP_START

Port From (https://github.com/TrinityCore/TrinityCore/commit/ebcd45b7e1eaa07386a3927d73575339535ec557)
This commit is contained in:
hondacrx
2022-05-30 13:42:39 -04:00
parent 774e978d18
commit 5ea0f1e468
3 changed files with 2 additions and 15 deletions
+1 -1
View File
@@ -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
+1 -11
View File
@@ -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
{
@@ -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<SmartAI>().StartPath(run, entry, repeat, unit);
uint quest = e.Action.wpStart.quest;