diff --git a/zone/command.cpp b/zone/command.cpp index cbcdf6bb3..829588ca7 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -3895,6 +3895,8 @@ void command_depopzone(Client *c, const Seperator *sep) void command_repop(Client *c, const Seperator *sep) { int timearg = 1; + int delay = 0; + if (sep->arg[1] && strcasecmp(sep->arg[1], "force") == 0) { timearg++; @@ -3913,13 +3915,19 @@ void command_repop(Client *c, const Seperator *sep) } if (!sep->IsNumber(timearg)) { - c->Message(0, "Zone depoped. Repoping now."); + c->Message(0, "Zone depopped - repopping now."); + zone->Repop(); + + /* Force a spawn2 timer trigger so we don't delay actually spawning the NPC's */ + zone->spawn2_timer.Trigger(); return; } c->Message(0, "Zone depoped. Repop in %i seconds", atoi(sep->arg[timearg])); - zone->Repop(atoi(sep->arg[timearg])*1000); + zone->Repop(atoi(sep->arg[timearg]) * 1000); + + zone->spawn2_timer.Trigger(); } void command_repopclose(Client *c, const Seperator *sep) diff --git a/zone/zone.cpp b/zone/zone.cpp index 6a0754dea..8441f7d82 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -1168,10 +1168,13 @@ bool Zone::Process() { spawn_conditions.Process(); if(spawn2_timer.Check()) { + LinkedListIterator iterator(spawn2_list); EQEmu::InventoryProfile::CleanDirty(); + Log(Logs::Detail, Logs::Spawns, "Running Zone::Process -> Spawn2::Process"); + iterator.Reset(); while (iterator.MoreElements()) { if (iterator.GetData()->Process()) { @@ -1181,10 +1184,10 @@ bool Zone::Process() { iterator.RemoveCurrent(); } } + if(adv_data && !did_adventure_actions) - { DoAdventureActions(); - } + } if(initgrids_timer.Check()) { //delayed grid loading stuff. diff --git a/zone/zone.h b/zone/zone.h index a3e9f59b4..b3ea9fbf1 100644 --- a/zone/zone.h +++ b/zone/zone.h @@ -106,6 +106,7 @@ public: inline const uint8 GetZoneType() const { return zone_type; } inline Timer* GetInstanceTimer() { return Instance_Timer; } + Timer spawn2_timer; inline glm::vec3 GetSafePoint() { return m_SafePoint; } inline const uint32& graveyard_zoneid() { return pgraveyard_zoneid; } @@ -336,7 +337,6 @@ private: Timer autoshutdown_timer; Timer clientauth_timer; - Timer spawn2_timer; Timer qglobal_purge_timer; Timer* Weather_Timer; Timer* Instance_Timer;