[Commands] Cleanup #heal Command. (#1717)

* [Commands] Cleanup #heal Command.
- Add message.

* Remove target requirement.

* Add self message.

* Typo.
This commit is contained in:
Kinglykrab 2021-11-12 08:06:53 -05:00 committed by GitHub
parent 8d9415191a
commit 110d2a0e10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4366,10 +4366,20 @@ void command_nudge(Client* c, const Seperator* sep)
void command_heal(Client *c, const Seperator *sep)
{
if (c->GetTarget()==0)
c->Message(Chat::White, "Error: #Heal: No Target.");
else
c->GetTarget()->Heal();
auto target = c->GetTarget() ? c->GetTarget() : c;
target->Heal();
if (c != target) {
c->Message(
Chat::White,
fmt::format(
"Healed {} ({}) to full.",
target->GetCleanName(),
target->GetID()
).c_str()
);
} else {
c->Message(Chat::White, "Healed yourself to full.");
}
}
void command_appearance(Client *c, const Seperator *sep)