From d5f839a4be933f944c0df46c233066e37966c263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A9=E9=B9=BF?= Date: Tue, 20 Sep 2022 09:00:10 +0800 Subject: [PATCH] fix(Core): SMART_EVENT_RANGE (#13064) * Update SmartScriptMgr.h * Update SmartScript.cpp --- src/server/game/AI/SmartScripts/SmartScript.cpp | 8 ++++---- src/server/game/AI/SmartScripts/SmartScriptMgr.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 0f1e187fbaf8f9..4fe9984c76adc3 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -4302,10 +4302,10 @@ void SmartScript::OnInitialize(WorldObject* obj, AreaTrigger const* at) InitTimer((*i));//calculate timers for first time use if (i->GetEventType() == SMART_EVENT_RANGE && i->GetActionType() == SMART_ACTION_ALLOW_COMBAT_MOVEMENT) { - if (i->action.combatMove.move == 1 && i->event.minMaxRepeat.min > minEnableDist) - minEnableDist = i->event.minMaxRepeat.min; - else if (i->action.combatMove.move == 0 && (i->event.minMaxRepeat.max < maxDisableDist || maxDisableDist == 0)) - maxDisableDist = i->event.minMaxRepeat.max; + if (i->action.combatMove.move == 1 && i->event.rangeRepeat.minRange > minEnableDist) + minEnableDist = i->event.rangeRepeat.minRange; + else if (i->action.combatMove.move == 0 && (i->event.rangeRepeat.maxRange < maxDisableDist || maxDisableDist == 0)) + maxDisableDist = i->event.rangeRepeat.maxRange; } // Xinef: if smartcast combat move flag is present diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index e7a1bcd32b3adc..4bd38286b11c88 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -124,7 +124,7 @@ enum SMART_EVENT SMART_EVENT_DEATH = 6, // NONE SMART_EVENT_EVADE = 7, // NONE SMART_EVENT_SPELLHIT = 8, // SpellID, School, CooldownMin, CooldownMax - SMART_EVENT_RANGE = 9, // MinDist, MaxDist, RepeatMin, RepeatMax + SMART_EVENT_RANGE = 9, // minRange, maxRange, repeatMin, repeatMax, onlyFireOnRepeat SMART_EVENT_OOC_LOS = 10, // HostilityMode, MaxRnage, CooldownMin, CooldownMax, PlayerOnly SMART_EVENT_RESPAWN = 11, // type, MapId, ZoneId SMART_EVENT_TARGET_HEALTH_PCT = 12, // HPMin%, HPMax%, RepeatMin, RepeatMax