From b813cf71bb37a424a87d5424f7c793583c7cf286 Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Wed, 9 Apr 2025 21:33:11 -0500 Subject: [PATCH] [Bots] Add valid state checks to ^clickitem (#4830) * [Bots] Add valid state checks to ^clickitem - Bots previously weren't checking if they were in a valid state or not before trying to click an item when told (in a death state, held, feared, silenced, in group/raid, etc.) * Add error output on no bots selected.= --- zone/bot_commands/click_item.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zone/bot_commands/click_item.cpp b/zone/bot_commands/click_item.cpp index d0ba47b69..492741821 100644 --- a/zone/bot_commands/click_item.cpp +++ b/zone/bot_commands/click_item.cpp @@ -48,9 +48,10 @@ void bot_command_click_item(Client* c, const Seperator* sep) sbl.erase(std::remove(sbl.begin(), sbl.end(), nullptr), sbl.end()); Mob* tar = c->GetTarget(); + bool is_success = false; for (auto my_bot : sbl) { - if (my_bot->BotPassiveCheck()) { + if (!my_bot->ValidStateCheck(c)) { continue; } @@ -68,6 +69,11 @@ void bot_command_click_item(Client* c, const Seperator* sep) continue; } + is_success = true; my_bot->TryItemClick(slot_id); } + + if (!is_success) { + c->Message(Chat::Yellow, "None of your bots are capable of doing that currently."); + } }