mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Optimize Mountaction: Movement Logic with Early Return for Matching F… (#1099)
* 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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user