mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Bot Commands] Toggle Enforce Spell Settings (#2682)
* [Bot Commands] Toggle enforcespellsettings * Cleanup * Update bot_command.cpp Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
This commit is contained in:
@@ -10782,7 +10782,7 @@ void bot_command_enforce_spell_list(Client* c, const Seperator *sep)
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Usage: {} [True/False]",
|
||||
"Usage: {} [True|False] (Blank to toggle]",
|
||||
sep->arg[0]
|
||||
).c_str()
|
||||
);
|
||||
@@ -10795,20 +10795,15 @@ void bot_command_enforce_spell_list(Client* c, const Seperator *sep)
|
||||
return;
|
||||
}
|
||||
|
||||
bool toggle = (
|
||||
sep->IsNumber(1) ?
|
||||
(std::stoi(sep->arg[1]) ? true : false) :
|
||||
atobool(sep->arg[1])
|
||||
);
|
||||
|
||||
my_bot->SetBotEnforceSpellSetting(toggle, true);
|
||||
bool enforce_state = (sep->argnum > 0) ? Strings::ToBool(sep->arg[1]) : !my_bot->GetBotEnforceSpellSetting();
|
||||
my_bot->SetBotEnforceSpellSetting(enforce_state, true);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{}'s Spell Settings List entries are now {}.",
|
||||
my_bot->GetCleanName(),
|
||||
toggle ? "enforced" : "optional"
|
||||
my_bot->GetBotEnforceSpellSetting() ? "enforced" : "optional"
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user