From 78223b7ebf6caea0378b44a021fe492c0f0429a3 Mon Sep 17 00:00:00 2001 From: hg <4683435+hgtw@users.noreply.github.com> Date: Mon, 5 Sep 2022 13:12:46 -0400 Subject: [PATCH] [Commands] Make #damage require a target (#2426) Fixes annoying issue where it affected the client if no target --- zone/gm_commands/damage.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zone/gm_commands/damage.cpp b/zone/gm_commands/damage.cpp index 490253cad..fbe1242d5 100755 --- a/zone/gm_commands/damage.cpp +++ b/zone/gm_commands/damage.cpp @@ -8,9 +8,10 @@ void command_damage(Client *c, const Seperator *sep) return; } - Mob* target = c; - if (c->GetTarget()) { - target = c->GetTarget(); + Mob* target = c->GetTarget(); + if (!target) { + c->Message(Chat::White, "You must have a target to use #damage."); + return; } int64 damage = std::stoll(sep->arg[1], nullptr, 10);