mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +00:00
[Commands] Cleanup #kill Command. (#2195)
- Cleanup messages and logic.
This commit is contained in:
parent
5b90d26a33
commit
e43538cf73
@ -2,11 +2,27 @@
|
|||||||
|
|
||||||
void command_kill(Client *c, const Seperator *sep)
|
void command_kill(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
if (!c->GetTarget()) {
|
auto target = c->GetTarget();
|
||||||
c->Message(Chat::White, "Error: #Kill: No target.");
|
if (!target) {
|
||||||
|
c->Message(Chat::White, "You must have a target to use this command.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (!c->GetTarget()->IsClient() || c->GetTarget()->CastToClient()->Admin() <= c->Admin()) {
|
|
||||||
c->GetTarget()->Kill();
|
if (
|
||||||
|
!target->IsClient() ||
|
||||||
|
target->CastToClient()->Admin() <= c->Admin()
|
||||||
|
) {
|
||||||
|
if (c != target) {
|
||||||
|
c->Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Killing {}.",
|
||||||
|
c->GetTargetDescription(target)
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
target->Kill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user