From 35044becc15cffd0aa9ec804a2a16f6af6f6734a Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Tue, 3 May 2022 23:05:09 -0400 Subject: [PATCH] [Commands] Cleanup #freeze and #unfreeze Commands. (#2102) - Cleanup messages and logic. - Remove the ability to #freeze yourself. --- zone/gm_commands/freeze.cpp | 14 +++++++++----- zone/gm_commands/unfreeze.cpp | 10 +++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/zone/gm_commands/freeze.cpp b/zone/gm_commands/freeze.cpp index 8cce36ba2..d817af169 100755 --- a/zone/gm_commands/freeze.cpp +++ b/zone/gm_commands/freeze.cpp @@ -2,11 +2,15 @@ void command_freeze(Client *c, const Seperator *sep) { - if (c->GetTarget() != 0) { - c->GetTarget()->SendAppearancePacket(AT_Anim, ANIM_FREEZE); - } - else { - c->Message(Chat::White, "ERROR: Freeze requires a target."); + if (c->GetTarget()) { + auto target = c->GetTarget(); + if (target != c) { + target->SendAppearancePacket(AT_Anim, ANIM_FREEZE); + } else { + c->Message(Chat::White, "You cannot freeze yourself."); + } + } else { + c->Message(Chat::White, "You must have a target to use this command."); } } diff --git a/zone/gm_commands/unfreeze.cpp b/zone/gm_commands/unfreeze.cpp index 9066af500..0785ca7c7 100755 --- a/zone/gm_commands/unfreeze.cpp +++ b/zone/gm_commands/unfreeze.cpp @@ -2,11 +2,11 @@ void command_unfreeze(Client *c, const Seperator *sep) { - if (c->GetTarget() != 0) { - c->GetTarget()->SendAppearancePacket(AT_Anim, ANIM_STAND); - } - else { - c->Message(Chat::White, "ERROR: Unfreeze requires a target."); + if (!c->GetTarget()) { + c->Message(Chat::White, "You must have a target to use this command."); + return; } + + c->GetTarget()->SendAppearancePacket(AT_Anim, ANIM_STAND); }