void CZoneInstance::DecreaseZoneCounter(CCharEntity* PChar) { CInstance* instance = PChar->PInstance; if (instance) { instance->DecreaseZoneCounter(PChar); instance->DespawnPC(PChar); CharZoneOut(PChar); PChar->StatusEffectContainer->DelStatusEffectSilent(EFFECT_LEVEL_RESTRICTION); PChar->PInstance = nullptr; if (instance->CharListEmpty()) { if (instance->Failed() || instance->Completed()) { instanceList.erase(std::find(instanceList.begin(), instanceList.end(), instance)); delete instance; } else { instance->SetWipeTime(server_clock::now()); } } } }
void CZoneInstance::DecreaseZoneCounter(CCharEntity* PChar) { CInstance* instance = PChar->PInstance; if (instance) { instance->DecreaseZoneCounter(PChar); instance->DespawnPC(PChar); CharZoneOut(PChar); PChar->PInstance = NULL; if (instance->CharListEmpty()) { if (instance->Failed() || instance->Completed()) { instanceList.erase(std::find(instanceList.begin(), instanceList.end(), instance)); delete instance; } else { instance->SetWipeTime(instance->GetElapsedTime(gettick())); } } } }
void CZone::DecreaseZoneCounter(CCharEntity* PChar) { m_zoneEntities->DecreaseZoneCounter(PChar); if (ZoneTimer && m_zoneEntities->CharListEmpty()) { ZoneTimer->m_type = CTaskMgr::TASK_REMOVE; ZoneTimer = nullptr; m_zoneEntities->HealAllMobs(); } else { m_zoneEntities->DespawnPC(PChar); } CharZoneOut(PChar); }