drink & food noncombat only

This commit is contained in:
Yunfan Li
2023-08-24 22:05:16 +08:00
parent 176b6f2bf1
commit 0d851002f2

View File

@@ -60,7 +60,7 @@ bool DrinkAction::isUseful()
bool DrinkAction::isPossible()
{
return sPlayerbotAIConfig->freeFood || UseItemAction::isPossible();
return !bot->IsInCombat() && (sPlayerbotAIConfig->freeFood || UseItemAction::isPossible());
}
bool EatAction::Execute(Event event)
@@ -112,5 +112,5 @@ bool EatAction::isUseful()
bool EatAction::isPossible()
{
return sPlayerbotAIConfig->freeFood || UseItemAction::isPossible();
return !bot->IsInCombat() && (sPlayerbotAIConfig->freeFood || UseItemAction::isPossible());
}