From 28be2b13c3b241512335c69a94edb19a30c6f9e7 Mon Sep 17 00:00:00 2001 From: SaW Date: Thu, 20 Mar 2025 19:53:56 +0100 Subject: [PATCH] =?UTF-8?q?Optimize=20Mountaction:=20Movement=20Logic=20wi?= =?UTF-8?q?th=20Early=20Return=20for=20Matching=20F=E2=80=A6=20(#1099)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Optimize Mountaction: Movement Logic with Early Return for Matching Forms or Speed Added a missing check, so if both master and bot are in matching forms or master is mounted with corresponding speed, early return as there is nothing to do. This improves logic, actions, and prevents some strange movement behavior when both master and bot already are in travel form. --- src/strategy/actions/CheckMountStateAction.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/strategy/actions/CheckMountStateAction.cpp b/src/strategy/actions/CheckMountStateAction.cpp index c054d619..b83018c5 100644 --- a/src/strategy/actions/CheckMountStateAction.cpp +++ b/src/strategy/actions/CheckMountStateAction.cpp @@ -237,6 +237,13 @@ bool CheckMountStateAction::TryForms(Player* master, int32 masterMountType, int3 if (!master) return false; + // If both master and bot are in matching forms or master is mounted with corresponding speed, nothing to do + else if + ((masterInShapeshiftForm == FORM_TRAVEL && botInShapeshiftForm == FORM_TRAVEL) || + ((masterInShapeshiftForm == FORM_FLIGHT || (masterMountType == 1 && masterSpeed == 149)) && botInShapeshiftForm == FORM_FLIGHT) || + ((masterInShapeshiftForm == FORM_FLIGHT_EPIC || (masterMountType == 1 && masterSpeed == 279)) && botInShapeshiftForm == FORM_FLIGHT_EPIC)) + return true; + // Check if master is in Travel Form and bot can do the same if (botAI->CanCastSpell(SPELL_TRAVEL_FORM, bot, true) && masterInShapeshiftForm == FORM_TRAVEL && botInShapeshiftForm != FORM_TRAVEL)