From efd04f8324ebfde070945c86c22ed9bcb8ec8067 Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Mon, 23 May 2022 19:56:19 -0400 Subject: [PATCH] [Commands] Cleanup #motd Command. (#2190) --- zone/command.cpp | 2 +- zone/gm_commands/motd.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index d5873fe23..efd259d28 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -237,7 +237,7 @@ int command_init(void) command_add("merchant_close_shop", "Closes a merchant shop", AccountStatus::GMAdmin, command_merchantcloseshop) || command_add("merchant_open_shop", "Opens a merchants shop", AccountStatus::GMAdmin, command_merchantopenshop) || command_add("modifynpcstat", "- Modifys a NPC's stats", AccountStatus::GMLeadAdmin, command_modifynpcstat) || - command_add("motd", "[new motd] - Set message of the day", AccountStatus::GMLeadAdmin, command_motd) || + command_add("motd", "[Message of the Day] - Set Message of the Day (leave empty to have no Message of the Day)", AccountStatus::GMLeadAdmin, command_motd) || command_add("movechar", "[Character ID|Character Name] [Zone ID|Zone Short Name] - Move an offline character to the specified zone", AccountStatus::Guide, command_movechar) || command_add("movement", "Various movement commands", AccountStatus::GMMgmt, command_movement) || command_add("myskills", "- Show details about your current skill levels", AccountStatus::Player, command_myskills) || diff --git a/zone/gm_commands/motd.cpp b/zone/gm_commands/motd.cpp index fdfba84b4..55a6d8ccc 100755 --- a/zone/gm_commands/motd.cpp +++ b/zone/gm_commands/motd.cpp @@ -5,11 +5,11 @@ extern WorldServer worldserver; void command_motd(Client *c, const Seperator *sep) { - auto outpack = new ServerPacket(ServerOP_Motd, sizeof(ServerMotd_Struct)); - ServerMotd_Struct *mss = (ServerMotd_Struct *) outpack->pBuffer; - strn0cpy(mss->myname, c->GetName(), 64); - strn0cpy(mss->motd, sep->argplus[1], 512); - worldserver.SendPacket(outpack); - safe_delete(outpack); + auto pack = new ServerPacket(ServerOP_Motd, sizeof(ServerMotd_Struct)); + auto m = (ServerMotd_Struct *) pack->pBuffer; + strn0cpy(m->myname, c->GetName(), sizeof(m->myname)); + strn0cpy(m->motd, sep->argplus[1], sizeof(m->motd)); + worldserver.SendPacket(pack); + safe_delete(pack); }