fix(Core/SmartAI): Suppress evade during SMART_ACTION_COMBAT_STOP#25249
Open
blinkysc wants to merge 1 commit intoazerothcore:masterfrom
Open
fix(Core/SmartAI): Suppress evade during SMART_ACTION_COMBAT_STOP#25249blinkysc wants to merge 1 commit intoazerothcore:masterfrom
blinkysc wants to merge 1 commit intoazerothcore:masterfrom
Conversation
CombatStop(true) triggers JustExitedCombat -> EnterEvadeMode, which fires evade handlers (despawn, fail quest, reset faction) breaking any script that stops combat intentionally (e.g. fake death + resurrect). Add mSuppressEvade flag to SmartAI that completely blocks EnterEvadeMode while SMART_ACTION_COMBAT_STOP is executing. Closes azerothcore#25246
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes Proposed:
This PR proposes changes to:
SMART_ACTION_COMBAT_STOP(action_type 27) callsCombatStop(true), which triggersJustExitedCombat→EnterEvadeMode. This causes any SmartAI creature that uses this action to unintentionally evade — firing evade handlers (despawn, fail quest, reset faction, walk home) and breaking the script's intended flow.The fix adds a
mSuppressEvadeflag toSmartAIthat completely blocksEnterEvadeModewhileSMART_ACTION_COMBAT_STOPis executing. This is stronger thanmEvadeDisabled, which still processesSMART_EVENT_EVADEhandlers.Affected creatures (27 uses across ~20 creatures/actionlists):
AI-assisted Pull Requests
Claude Code with azerothMCP was used to investigate the issue, trace the evade chain through the codebase, and prepare the fix.
Issues Addressed:
SOURCE:
The changes have been validated through:
Code tracing confirmed
CombatStop(true)→EndAllPvECombat()→CombatReference::EndCombat()→JustExitedCombat()→EnterEvadeMode(). Debug logging on a live server confirmed the full evade chain fires for Mogor entry 18069.Tests Performed:
This PR has been:
Regression testing recommended for other creatures using
SMART_ACTION_COMBAT_STOPlisted above.How to Test the Changes:
.go c id 18069to teleport to Mogor's area (Ring of Blood, Nagrand)Known Issues and TODO List: