From 458f5b2d0f813e74faa72c4d0d7d26ea82963a28 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Tue, 8 Oct 2024 23:54:34 -0700 Subject: [PATCH] allow $edit secid if character is level 1 --- README.md | 2 +- src/ChatCommands.cc | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 939ccb76..f68d62c8 100644 --- a/README.md +++ b/README.md @@ -638,6 +638,7 @@ Some subcommands are always available. They are: * `$edit language L`: Set your language (Generally only useful on BB; values for L: J = Japanese, E = English, G = German, F = French, S = Spanish, B = Simplified Chinese, T = Traditional Chinese, K = Korean) * `$edit name NAME`: Set your character name * `$edit npc NPC-NAME`: Set or remove an NPC skin on your character (NPC-NAME can be ninja, rico, sonic, knuckles, tails, flowen, elly, or none) +* `$edit secid SECID-NAME`: Set your section ID (cheat mode is required for this unless your character is Level 1) The remaining subcommands are only available if cheat mode is enabled on the server. They are: * `$edit atp N`: Set your ATP to N until stats are updated (e.g. by leveling up) @@ -650,7 +651,6 @@ The remaining subcommands are only available if cheat mode is enabled on the ser * `$edit meseta N`: Set the amount of Meseta in your inventory * `$edit exp N`: Set your total amount of EXP (does not affect level) * `$edit level N`: Set your current level (recomputes stats, but does not affect EXP) -* `$edit secid SECID-NAME`: Set your section ID * `$edit tech TECH-NAME LEVEL`: Set the level of one of your techniques # Non-server features diff --git a/src/ChatCommands.cc b/src/ChatCommands.cc index 39680c5d..ee7103c3 100644 --- a/src/ChatCommands.cc +++ b/src/ChatCommands.cc @@ -1420,7 +1420,11 @@ static void server_command_edit(shared_ptr c, const std::string& args) { if (sys) { sys->language = new_language; } - } else if (tokens.at(0) == "secid" && cheats_allowed) { + } else if (tokens.at(0) == "secid") { + if (!cheats_allowed && (p->disp.stats.level > 0)) { + send_text_message(c, "$C6You cannot change\nyour Section ID\nafter level 1"); + return; + } uint8_t secid = section_id_for_name(tokens.at(1)); if (secid == 0xFF) { send_text_message(c, "$C6No such section ID");