From 990729fe21e5ac0d9f15cdcd45cd0e5b65e93c69 Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Wed, 10 Nov 2021 21:21:06 -0500 Subject: [PATCH] [Commands] Cleanup #distance Command. (#1707) - Cleanup message. --- zone/command.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index 5ed0e8f03..49952eaf1 100755 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -13720,10 +13720,22 @@ void command_globalview(Client *c, const Seperator *sep) } void command_distance(Client *c, const Seperator *sep) { - if(c && c->GetTarget()) { + if (c->GetTarget()) { Mob* target = c->GetTarget(); - - c->Message(Chat::White, "Your target, %s, is %1.1f units from you.", c->GetTarget()->GetName(), Distance(c->GetPosition(), target->GetPosition())); + if (c != target) { + c->Message( + Chat::White, + fmt::format( + "{} ({}) is {:.2f} units from you.", + target->GetCleanName(), + target->GetID(), + Distance( + c->GetPosition(), + target->GetPosition() + ) + ).c_str() + ); + } } }