Chris Miles 714fb032e9
[Crash] Fix spawn race condition shown by #repop (#2455)
* Troubleshooting

* Debugging

* Debugging

* Debugging

* Debugging

* Remove debug line

* Revert back to GetRawNPCTypeName
2022-09-28 21:03:05 -05:00

25 lines
508 B
C++
Executable File

#include "../client.h"
void command_repop(Client *c, const Seperator *sep)
{
int arguments = sep->argnum;
if (!arguments) {
entity_list.ClearAreas();
c->Message(Chat::White, "Zone depopped, repopping now.");
zone->Repop();
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();
}