Add rule instead of define for IDLE_WHEN_EMPTY

This commit is contained in:
E Spause 2017-03-15 06:37:03 -04:00
parent c3b7f6d0bf
commit 542d0795c4
2 changed files with 10 additions and 7 deletions

View File

@ -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)

View File

@ -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) {