diff --git a/common/ruletypes.h b/common/ruletypes.h index 9ed9fa5a2..d6a0c7346 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -266,6 +266,7 @@ RULE_INT(Zone, MinOfflineTimeToReplenishments, 21600) // 21600 seconds is 6 Hour RULE_BOOL(Zone, UseZoneController, true) // Enables the ability to use persistent quest based zone controllers (zone_controller.pl/lua) RULE_BOOL(Zone, EnableZoneControllerGlobals, false) // Enables the ability to use quest globals with the zone controller NPC RULE_INT(Zone, GlobalLootMultiplier, 1) // Sets Global Loot drop multiplier for database based drops, useful for double, triple loot etc. +RULE_BOOL(Zone, IdleWhenEmpty, true) // Don't process NPCs while zone is empty. Defaults to true. RULE_CATEGORY_END() RULE_CATEGORY(Map) diff --git a/zone/entity.cpp b/zone/entity.cpp index 2bc1b99ed..032c35820 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -408,10 +408,10 @@ void EntityList::RaidProcess() void EntityList::DoorProcess() { -#ifdef IDLE_WHEN_EMPTY - if (numclients < 1) - return; -#endif + if (RuleB(Zone, IdleWhenEmpty)) { + if (numclients < 1) + return; + } if (door_list.empty()) { net.door_timer.Disable(); return; @@ -477,7 +477,7 @@ void EntityList::MobProcess() size_t sz = mob_list.size(); -#ifdef IDLE_WHEN_EMPTY + if (RuleB(Zone, IdleWhenEmpty)) { if (numclients > 0 || mob->GetWanderType() == 4 || mob->GetWanderType() == 6) { // Normal processing, or assuring that spawns that should @@ -490,9 +490,11 @@ void EntityList::MobProcess() // At the very least, process that. mob_dead = mob->CastToNPC()->GetDepop(); } -#else + } + else + { mob_dead = !mob->Process(); -#endif + } size_t a_sz = mob_list.size(); if(a_sz > sz) {