Beispiel #1
0
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()));
			}
		}
	}
}