From e8607a0c78541f20cf5e6614614970b6795fef47 Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Sat, 13 Nov 2021 05:25:58 -0500 Subject: [PATCH] [Commands] Cleanup #checklos Command. (#1744) - Cleanup message and logic. --- zone/command.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index 1dea47cb5..c7f6b3b3a 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -9582,17 +9582,20 @@ void command_oocmute(Client *c, const Seperator *sep) void command_checklos(Client *c, const Seperator *sep) { - if (c->GetTarget()) { - if (c->CheckLosFN(c->GetTarget())) { - c->Message(Chat::White, "You have LOS to %s", c->GetTarget()->GetName()); - } - else { - c->Message(Chat::White, "You do not have LOS to %s", c->GetTarget()->GetName()); - } - } - else { - c->Message(Chat::White, "ERROR: Target required"); + if (!c->GetTarget()) { + c->Message(Chat::White, "You must have a target to use this command."); } + + bool has_los = c->CheckLosFN(c->GetTarget()); + c->Message( + Chat::White, + fmt::format( + "You {}have line of sight to {} ({}).", + has_los ? "" : "do not ", + c->GetTarget()->GetCleanName(), + c->GetTarget()->GetID() + ).c_str() + ); } void command_set_adventure_points(Client *c, const Seperator *sep)