mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[Bug Fix] Fixes to zone idle while empty changes. (#4006)
This commit is contained in:
+16
-25
@@ -491,42 +491,33 @@ void EntityList::MobProcess()
|
||||
old_client_count > 0 &&
|
||||
zone->GetSecondsBeforeIdle() > 0
|
||||
) {
|
||||
if (!zone->IsIdle()) {
|
||||
LogInfo(
|
||||
"Zone will go into an idle state after [{}] second{}.",
|
||||
zone->GetSecondsBeforeIdle(),
|
||||
zone->GetSecondsBeforeIdle() != 1 ? "s" : ""
|
||||
);
|
||||
}
|
||||
|
||||
LogInfo(
|
||||
"Zone will go into an idle state after [{}] second{}.",
|
||||
zone->GetSecondsBeforeIdle(),
|
||||
zone->GetSecondsBeforeIdle() != 1 ? "s" : ""
|
||||
);
|
||||
mob_settle_timer->Start(zone->GetSecondsBeforeIdle() * 1000);
|
||||
}
|
||||
|
||||
old_client_count = numclients;
|
||||
|
||||
if (numclients == 0 && mob_settle_timer->Check()) {
|
||||
if (!zone->IsIdle()) {
|
||||
LogInfo(
|
||||
"Zone has gone idle after [{}] second{}.",
|
||||
zone->GetSecondsBeforeIdle(),
|
||||
zone->GetSecondsBeforeIdle() != 1 ? "s" : ""
|
||||
);
|
||||
|
||||
zone->SetIsIdle(true);
|
||||
}
|
||||
LogInfo(
|
||||
"Zone has gone idle after [{}] second{}.",
|
||||
zone->GetSecondsBeforeIdle(),
|
||||
zone->GetSecondsBeforeIdle() != 1 ? "s" : ""
|
||||
);
|
||||
mob_settle_timer->Disable();
|
||||
}
|
||||
|
||||
// Disable settle timer if someone zones into empty zone
|
||||
if (numclients > 0 || mob_settle_timer->Check()) {
|
||||
if (zone->IsIdle()) {
|
||||
LogInfo("Zone is no longer idle.");
|
||||
|
||||
zone->SetIsIdle(false);
|
||||
if (mob_settle_timer->Enabled()) {
|
||||
LogInfo("Zone is no longer scheduled to go idle.");
|
||||
mob_settle_timer->Disable();
|
||||
}
|
||||
|
||||
mob_settle_timer->Disable();
|
||||
}
|
||||
|
||||
old_client_count = numclients;
|
||||
|
||||
Spawn2* s2 = mob->CastToNPC()->respawn2;
|
||||
|
||||
// Perform normal mob processing if any of these are true:
|
||||
|
||||
Reference in New Issue
Block a user