From adfec15893cd657c7ef3352ced0d2bc0414b1e48 Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Fri, 6 May 2022 20:02:32 -0400 Subject: [PATCH] [Commands] Cleanup #resetaa Command. (#2132) * [Commands] Cleanup #resetaa Command. - Cleanup messages and logic. * Update resetaa.cpp --- zone/gm_commands/resetaa.cpp | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/zone/gm_commands/resetaa.cpp b/zone/gm_commands/resetaa.cpp index d83ba6beb..f645ec713 100755 --- a/zone/gm_commands/resetaa.cpp +++ b/zone/gm_commands/resetaa.cpp @@ -2,12 +2,28 @@ void command_resetaa(Client *c, const Seperator *sep) { - if (c->GetTarget() && c->GetTarget()->IsClient()) { - c->GetTarget()->CastToClient()->ResetAA(); - c->Message(Chat::Red, "Successfully reset %s's AAs", c->GetTarget()->GetName()); - } - else { - c->Message(Chat::White, "Usage: Target a client and use #resetaa to reset the AA data in their Profile."); + if (!c->GetTarget() || !c->GetTarget()->IsClient()) { + c->Message(Chat::White, "You must target a player to use this command."); + return; } + + auto target = c->GetTarget()->CastToClient(); + target->ResetAA(); + + c->Message( + Chat::White, + fmt::format( + "Successfully reset all Alternate Advancements for {}.", + ( + c == target ? + "yourself" : + fmt::format( + "{} ({})", + target->GetCleanName(), + target->GetID() + ) + ) + ).c_str() + ); }