From 179c34e3a9ff48566e4da81e8fa59985f1f0b3b9 Mon Sep 17 00:00:00 2001 From: kadeshar Date: Thu, 28 Aug 2025 18:25:13 +0200 Subject: [PATCH] Food cheat fixes (#1594) * - Fixed bug with InitFood and food cheat - Fixed food cheat description in config * - Fixed bug with initself command --- conf/playerbots.conf.dist | 2 +- src/factory/PlayerbotFactory.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/playerbots.conf.dist b/conf/playerbots.conf.dist index 4d9e89d9..96161f5c 100644 --- a/conf/playerbots.conf.dist +++ b/conf/playerbots.conf.dist @@ -492,7 +492,7 @@ AiPlayerbot.AutoGearQualityLimit = 3 AiPlayerbot.AutoGearScoreLimit = 0 # Enable/Disable cheats for bots -# "food" (bots use cheat when eat or drink) +# "food" (bots eat or drink without using food or drinks from their inventory) # "gold" (bots have infinite gold) # "health" (bots have infinite health) # "mana" (bots have infinite mana) diff --git a/src/factory/PlayerbotFactory.cpp b/src/factory/PlayerbotFactory.cpp index b3ca0e9b..23d956cd 100644 --- a/src/factory/PlayerbotFactory.cpp +++ b/src/factory/PlayerbotFactory.cpp @@ -3244,7 +3244,7 @@ std::vector PlayerbotFactory::GetCurrentGemsCount() void PlayerbotFactory::InitFood() { - if (!botAI->HasCheat(BotCheatMask::food)) + if (botAI && botAI->HasCheat(BotCheatMask::food)) { return; }