diff options
author | jackpoz <giacomopoz@gmail.com> | 2020-09-05 12:46:09 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-02-05 12:08:58 +0100 |
commit | ae6f8bc4f546b0db9b39acad03687d968a348779 (patch) | |
tree | 50e665c999c729ded259543ba261e2bfee07065e | |
parent | d561a691220c2c0856f63ff6cbcd4d0af8c761d5 (diff) |
Core/SAI: Do not allow SMART_EVENT_RESET to call SMART_ACTION_CALL_SCRIPT_RESET
There might be cases where this should be allowed (i.e. if the SMART_TARGET_* is another object) but for now we'll just never allow it.
(cherry picked from commit 28921f191de2269dd90b50ac99dd0d29ba90d0c4)
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index 0f7d64c2d54..40a199552a6 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -1093,6 +1093,14 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) return false; } break; + case SMART_EVENT_RESET: + if (e.action.type == SMART_ACTION_CALL_SCRIPT_RESET) + { + // There might be SMART_TARGET_* cases where this should be allowed, they will be handled if needed + TC_LOG_ERROR("sql.sql", "SmartAIMgr: Entry " SI64FMTD " SourceType %u Event %u uses event SMART_EVENT_RESET and action SMART_ACTION_CALL_SCRIPT_RESET, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id); + return false; + } + break; case SMART_EVENT_QUEST_OBJ_COPLETETION: if (!sObjectMgr->GetQuestObjective(e.event.questObjective.id)) { @@ -1121,7 +1129,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e) case SMART_EVENT_DEATH: case SMART_EVENT_EVADE: case SMART_EVENT_REACHED_HOME: - case SMART_EVENT_RESET: case SMART_EVENT_JUST_SUMMONED: case SMART_EVENT_WAYPOINT_START: case SMART_EVENT_WAYPOINT_REACHED: |