mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-16 13:09:50 -04:00
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 28921f191d)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user