From 85c3255568434deb1b1bb185aadfb7aa6f0581dc Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Wed, 29 Apr 2026 01:59:19 -0500 Subject: [PATCH] [Bots] Command add fix for spelltypeids/spelltypenames (#5074) --- zone/bot_command.cpp | 6 +++--- zone/bot_command.h | 2 +- zone/bot_commands/bot_spelltypes.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index 594d28b47..966d951b7 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -775,7 +775,7 @@ void helper_send_usage_required_bots(Client *bot_owner, uint16 spell_type) bot_owner->Message(Chat::Green, "%s", description.c_str()); } -void SendSpellTypeWindow(Client* c, const Seperator* sep) { +void SendSpellTypeWindow(Client* c, const Seperator* sep, bool short_names) { std::string arg0 = sep->arg[0]; std::string arg1 = sep->arg[1]; @@ -828,7 +828,7 @@ void SendSpellTypeWindow(Client* c, const Seperator* sep) { std::string popup_text = DialogueWindow::TableRow( DialogueWindow::TableCell(DialogueWindow::ColorMessage(goldenrod, spell_type_field)) + - DialogueWindow::TableCell((!arg0.compare("^spelltypeids") ? DialogueWindow::ColorMessage(goldenrod, id_field) : DialogueWindow::ColorMessage(goldenrod, shortname_field))) + DialogueWindow::TableCell((!short_names ? DialogueWindow::ColorMessage(goldenrod, id_field) : DialogueWindow::ColorMessage(goldenrod, shortname_field))) ); popup_text += DialogueWindow::TableRow( @@ -845,7 +845,7 @@ void SendSpellTypeWindow(Client* c, const Seperator* sep) { popup_text += DialogueWindow::TableRow( DialogueWindow::TableCell(DialogueWindow::ColorMessage(forest_green, Bot::GetSpellTypeNameByID(i))) + - DialogueWindow::TableCell((!arg0.compare("^spelltypeids") ? DialogueWindow::ColorMessage(slate_blue, std::to_string(i)) : DialogueWindow::ColorMessage(slate_blue, Bot::GetSpellTypeShortNameByID(i)))) + DialogueWindow::TableCell((!short_names ? DialogueWindow::ColorMessage(slate_blue, std::to_string(i)) : DialogueWindow::ColorMessage(slate_blue, Bot::GetSpellTypeShortNameByID(i)))) ); } diff --git a/zone/bot_command.h b/zone/bot_command.h index 6f3de0544..870697b4d 100644 --- a/zone/bot_command.h +++ b/zone/bot_command.h @@ -1182,4 +1182,4 @@ bool helper_is_help_or_usage(const char* arg); bool helper_no_available_bots(Client *bot_owner, Bot *my_bot = nullptr); void helper_send_available_subcommands(Client *bot_owner, const char* command_simile, std::vector subcommand_list); void helper_send_usage_required_bots(Client *bot_owner, uint16 spell_type); -void SendSpellTypeWindow(Client* c, const Seperator* sep); +void SendSpellTypeWindow(Client* c, const Seperator* sep, bool short_names = false); diff --git a/zone/bot_commands/bot_spelltypes.cpp b/zone/bot_commands/bot_spelltypes.cpp index f9b39fc7b..7e7f0fa39 100644 --- a/zone/bot_commands/bot_spelltypes.cpp +++ b/zone/bot_commands/bot_spelltypes.cpp @@ -24,5 +24,5 @@ void bot_command_spelltype_ids(Client* c, const Seperator* sep) void bot_command_spelltype_names(Client* c, const Seperator* sep) { - SendSpellTypeWindow(c, sep); + SendSpellTypeWindow(c, sep, true); }