Fix repop crash

This commit is contained in:
neckkola
2022-02-27 15:25:15 -04:00
parent d67fa473a2
commit 9836c80a9d
4 changed files with 6 additions and 4 deletions
+3 -2
View File
@@ -24,9 +24,10 @@ void command_repop(Client *c, const Seperator *sep)
if (!sep->IsNumber(timearg)) {
c->Message(Chat::White, "Zone depopped - repopping now.");
zone->spawn2_timer.Disable();
zone->Repop();
zone->spawn2_timer.Enable();
/* Force a spawn2 timer trigger so we don't delay actually spawning the NPC's */
zone->spawn2_timer.Trigger();
return;
+1 -1
View File
@@ -579,7 +579,7 @@ int main(int argc, char** argv) {
EQ::Timer process_timer(loop_fn);
process_timer.Start(32, true);
EQ::EventLoop::Get().Run();
entity_list.Clear();
+1 -1
View File
@@ -154,7 +154,7 @@ bool Spawn2::Process() {
return true;
}
if (timer.Check()) {
if (timer.Check() && zone->spawn2_timer.Enabled()) {
timer.Disable();
LogSpawns("Spawn2 [{}]: Timer has triggered", spawn2_id);
+1
View File
@@ -1738,6 +1738,7 @@ bool Zone::Depop(bool StartSpawnTimer) {
itr = npctable.begin();
delete itr->second;
itr->second = nullptr;
npctable.erase(itr);
}