diff --git a/zone/command.cpp b/zone/command.cpp index f74a951c0..8163dcb0f 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -152,7 +152,7 @@ int command_init(void) command_add("depopzone", "- Depop the zone", AccountStatus::GMAdmin, command_depopzone) || command_add("devtools", "- Manages devtools", AccountStatus::GMMgmt, command_devtools) || command_add("details", "- Change the details of your target (Drakkin Only)", AccountStatus::QuestTroupe, command_details) || - command_add("disablerecipe", "[recipe_id] - Disables a recipe using the recipe id.", AccountStatus::QuestTroupe, command_disablerecipe) || + command_add("disablerecipe", "[Recipe ID] - Disables a Recipe", AccountStatus::QuestTroupe, command_disablerecipe) || command_add("disarmtrap", "Analog for ldon disarm trap for the newer clients since we still don't have it working.", AccountStatus::QuestTroupe, command_disarmtrap) || command_add("distance", "- Reports the distance between you and your target.", AccountStatus::QuestTroupe, command_distance) || command_add("door", "Door editing command", AccountStatus::QuestTroupe, command_door) || diff --git a/zone/gm_commands/disablerecipe.cpp b/zone/gm_commands/disablerecipe.cpp index ca5c6e152..b09a6317c 100755 --- a/zone/gm_commands/disablerecipe.cpp +++ b/zone/gm_commands/disablerecipe.cpp @@ -2,28 +2,28 @@ void command_disablerecipe(Client *c, const Seperator *sep) { - uint32 recipe_id = 0; - bool success = false; - if (c) { - if (sep->argnum == 1) { - recipe_id = atoi(sep->arg[1]); - } - else { - c->Message(Chat::White, "Invalid number of arguments.\nUsage: #disablerecipe recipe_id"); - return; - } - if (recipe_id > 0) { - success = content_db.DisableRecipe(recipe_id); - if (success) { - c->Message(Chat::White, "Recipe disabled."); - } - else { - c->Message(Chat::White, "Recipe not disabled."); - } - } - else { - c->Message(Chat::White, "Invalid recipe id.\nUsage: #disablerecipe recipe_id"); - } + int arguments = sep->argnum; + if (!arguments || !sep->IsNumber(1)) { + c->Message(Chat::White, "Usage: #disablerecipe [Recipe ID]"); + return; } -} + auto recipe_id = std::stoul(sep->arg[1]); + if (!recipe_id) { + c->Message(Chat::White, "Usage: #disablerecipe [Recipe ID]"); + return; + } + + c->Message( + Chat::White, + fmt::format( + "Recipe ID {} {} disabled.", + recipe_id, + ( + content_db.DisableRecipe(recipe_id) ? + "successfully" : + "failed to be" + ) + ).c_str() + ); +}