Kinglykrab 597e324319
[Bug FIx] Fix #repop Command. (#2159)
If you use no arguments, the command does not repop.
2022-05-08 17:01:50 -04:00

26 lines
545 B
C++
Executable File

#include "../client.h"
void command_repop(Client *c, const Seperator *sep)
{
int arguments = sep->argnum;
if (!arguments) {
c->Message(Chat::White, "Zone depopped, repopping now.");
zone->Repop();
zone->spawn2_timer.Trigger();
return;
}
bool is_force = !strcasecmp(sep->arg[1], "force");
if (is_force) {
zone->ClearSpawnTimers();
c->Message(Chat::White, "Zone depopped, forcefully repopping now.");
} else {
c->Message(Chat::White, "Zone depopped, repopping now.");
}
zone->Repop();
zone->spawn2_timer.Trigger();
}