aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2020-09-05 12:46:09 +0200
committerjackpoz <giacomopoz@gmail.com>2020-09-05 12:46:09 +0200
commit28921f191de2269dd90b50ac99dd0d29ba90d0c4 (patch)
tree511dc43d0029a32d9ad25482ba7f556ff45ce579 /src
parentca2159bf405fb96a8eba9f1e58bda7ee6c7eb247 (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.
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp9
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 6ee459d2ad1..eafb6253b9e 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -1018,6 +1018,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 %d 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_LINK:
case SMART_EVENT_GO_LOOT_STATE_CHANGED:
case SMART_EVENT_GO_EVENT_INFORM:
@@ -1034,7 +1042,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_QUEST_ACCEPTED:
case SMART_EVENT_QUEST_OBJ_COPLETETION:
case SMART_EVENT_QUEST_COMPLETION: