From aaae6b6476652b98191eb72311aabace95f8243e Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Mon, 31 Jul 2023 12:44:43 +0800 Subject: [PATCH] fix freefood --- src/strategy/actions/NonCombatActions.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/strategy/actions/NonCombatActions.cpp b/src/strategy/actions/NonCombatActions.cpp index d046efc6..97db336a 100644 --- a/src/strategy/actions/NonCombatActions.cpp +++ b/src/strategy/actions/NonCombatActions.cpp @@ -17,6 +17,7 @@ bool DrinkAction::Execute(Event event) if (sPlayerbotAIConfig->freeFood) { + if (bot->IsNonMeleeSpellCast(true)) return false; @@ -44,8 +45,9 @@ bool DrinkAction::Execute(Event event) botAI->SetNextCheckDelay(delay); - - return botAI->CastSpell(24707, bot); + bot->AddAura(24707, bot); + return true; + // return botAI->CastSpell(24707, bot); } return UseItemAction::Execute(event); @@ -94,9 +96,9 @@ bool EatAction::Execute(Event event) else delay = 20000.0f * (100 - p) / 100.0f; - botAI->CastSpell(24707, bot); botAI->SetNextCheckDelay(delay); - + + bot->AddAura(24707, bot); return true; }