From f26c4e99f6530441b703300af952d9fee9781924 Mon Sep 17 00:00:00 2001 From: Gonzalo Date: Thu, 25 Sep 2025 18:26:28 -0300 Subject: [PATCH] Fix: Prevent bots from eating and drinking while mounted This change modifies the `DrinkAction::Execute()` and `EatAction::Execute()` functions in `src/strategy/actions/NonCombatActions.cpp`. Previously, playerbots could attempt to eat food or drink water while mounted, which is not possible in the game and creates unrealistic behavior. This fix adds mount state checks to both actions: 1. `DrinkAction::Execute()` now checks `bot->IsMounted()` and returns false if mounted 2. `EatAction::Execute()` now checks `bot->IsMounted()` and returns false if mounted This prevents bots from attempting to consume food or drinks while mounted, improving bot behavior realism and preventing unnecessary action attempts that would fail anyway. --- src/strategy/actions/NonCombatActions.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/strategy/actions/NonCombatActions.cpp b/src/strategy/actions/NonCombatActions.cpp index d3c49dec..b696a27b 100644 --- a/src/strategy/actions/NonCombatActions.cpp +++ b/src/strategy/actions/NonCombatActions.cpp @@ -13,6 +13,10 @@ bool DrinkAction::Execute(Event event) if (bot->IsInCombat()) return false; + // Don't drink while mounted + if (bot->IsMounted()) + return false; + bool hasMana = AI_VALUE2(bool, "has mana", "self target"); if (!hasMana) return false; @@ -66,6 +70,10 @@ bool EatAction::Execute(Event event) if (bot->IsInCombat()) return false; + // Don't eat while mounted + if (bot->IsMounted()) + return false; + if (botAI->HasCheat(BotCheatMask::food)) { // if (bot->IsNonMeleeSpellCast(true))