[Commands] Cleanup #distance Command. (#1707)

- Cleanup message.
This commit is contained in:
Kinglykrab 2021-11-10 21:21:06 -05:00 committed by GitHub
parent aac0dd2993
commit 990729fe21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()
);
}
}
}