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/LootObjectStack.cpp b/src/LootObjectStack.cpp index adce7f39..b7d0caf9 100644 --- a/src/LootObjectStack.cpp +++ b/src/LootObjectStack.cpp @@ -299,9 +299,10 @@ bool LootObject::IsLootPossible(Player* bot) return false; } - // Prevent bot from running to chests that are unlootable (e.g. Gunship Armory before completing the event) + // Prevent bot from running to chests that are unlootable (e.g. Gunship Armory before completing the event) or on + // respawn time GameObject* go = botAI->GetGameObject(guid); - if (go && go->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND | GO_FLAG_NOT_SELECTABLE)) + if (go && (go->HasFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND | GO_FLAG_NOT_SELECTABLE) || !go->isSpawned())) return false; if (skillId == SKILL_NONE) @@ -407,4 +408,4 @@ LootObject LootObjectStack::GetNearest(float maxDistance) } return nearest; -} \ No newline at end of file +} 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; }