[Commands] Cleanup #checklos Command. (#1744)

- Cleanup message and logic.
This commit is contained in:
Kinglykrab 2021-11-13 05:25:58 -05:00 committed by GitHub
parent 9c55cf9a8e
commit e8607a0c78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9582,17 +9582,20 @@ void command_oocmute(Client *c, const Seperator *sep)
void command_checklos(Client *c, const Seperator *sep) void command_checklos(Client *c, const Seperator *sep)
{ {
if (c->GetTarget()) { if (!c->GetTarget()) {
if (c->CheckLosFN(c->GetTarget())) { c->Message(Chat::White, "You must have a target to use this command.");
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");
} }
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) void command_set_adventure_points(Client *c, const Seperator *sep)