mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
[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.=
This commit is contained in:
parent
48ecd1222f
commit
b813cf71bb
@ -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.");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user