[Commands] Make #damage require a target (#2426)

Fixes annoying issue where it affected the client if no target
This commit is contained in:
hg authored and GitHub committed 2022-09-05 12:12:46 -05:00
1 parent 73f310d098
commit 78223b7ebf
1 file changed
+4 -3
+4 -3
View File
@@ -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);