From 927d379e75f83460924040ae5a04c0f568becc37 Mon Sep 17 00:00:00 2001 From: Jonathan Sider Date: Wed, 28 Jun 2023 17:18:44 -0700 Subject: [PATCH] [Bug Fix] Add check for underscores in botcreate command (#3458) * Update bot_command.cpp with botcreate check Check for underscores in bot names as the server will replace with a space and add to the database. The bot can't be deleted/summoned or changed except by editing the database * Update bot_command.cpp * Update bot_command.cpp --------- Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com> --- zone/bot_command.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index 3ccd3a702..79ad9e064 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -5512,6 +5512,12 @@ void bot_subcommand_bot_create(Client *c, const Seperator *sep) std::string bot_name = sep->arg[1]; bot_name = Strings::UcFirst(bot_name); + + if (Strings::Contains(bot_name, "_")) { + c->Message(Chat::White, "Bot name cannot contain underscores!"); + return; + } + if (arguments < 2 || !sep->IsNumber(2)) { c->Message(Chat::White, "Invalid class!"); return;