From f3a2696be5266b31533a3d5e4c54c0c10310a02d Mon Sep 17 00:00:00 2001 From: MowFord <131182600+MowFord@users.noreply.github.com> Date: Sat, 9 Dec 2023 19:06:45 -0600 Subject: [PATCH] Null check for influence buff latents --- src/map/latent_effect_container.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/map/latent_effect_container.cpp b/src/map/latent_effect_container.cpp index 404fd9edda6..9043036e293 100644 --- a/src/map/latent_effect_container.cpp +++ b/src/map/latent_effect_container.cpp @@ -717,25 +717,33 @@ bool CLatentEffectContainer::ProcessLatentEffect(CLatentEffect& latentEffect) case LATENT::SIGNET_BONUS: { CBattleEntity* PTarget = m_POwner->GetBattleTarget(); - expression = - PTarget != nullptr && m_POwner->GetMLevel() >= PTarget->GetMLevel() && m_POwner->loc.zone->GetRegionID() < REGION_TYPE::WEST_AHT_URHGAN; + expression = PTarget != nullptr && + m_POwner->GetMLevel() >= PTarget->GetMLevel() && + m_POwner->loc.zone != nullptr && + m_POwner->loc.zone->GetRegionID() < REGION_TYPE::WEST_AHT_URHGAN; break; } case LATENT::SANCTION_REGEN_BONUS: - expression = m_POwner->loc.zone->GetRegionID() >= REGION_TYPE::WEST_AHT_URHGAN && m_POwner->loc.zone->GetRegionID() <= REGION_TYPE::ALZADAAL && + expression = m_POwner->loc.zone != nullptr && + m_POwner->loc.zone->GetRegionID() >= REGION_TYPE::WEST_AHT_URHGAN && + m_POwner->loc.zone->GetRegionID() <= REGION_TYPE::ALZADAAL && ((float)m_POwner->health.hp / m_POwner->health.maxhp) * 100 < latentEffect.GetConditionsValue(); break; case LATENT::SANCTION_REFRESH_BONUS: - expression = m_POwner->loc.zone->GetRegionID() >= REGION_TYPE::WEST_AHT_URHGAN && m_POwner->loc.zone->GetRegionID() <= REGION_TYPE::ALZADAAL && + expression = m_POwner->loc.zone != nullptr && + m_POwner->loc.zone->GetRegionID() >= REGION_TYPE::WEST_AHT_URHGAN && + m_POwner->loc.zone->GetRegionID() <= REGION_TYPE::ALZADAAL && ((float)m_POwner->health.mp / m_POwner->health.maxmp) * 100 < latentEffect.GetConditionsValue(); break; case LATENT::SIGIL_REGEN_BONUS: - expression = m_POwner->loc.zone->GetRegionID() >= REGION_TYPE::RONFAURE_FRONT && + expression = m_POwner->loc.zone != nullptr && + m_POwner->loc.zone->GetRegionID() >= REGION_TYPE::RONFAURE_FRONT && m_POwner->loc.zone->GetRegionID() <= REGION_TYPE::VALDEAUNIA_FRONT && ((float)m_POwner->health.hp / m_POwner->health.maxhp) * 100 < latentEffect.GetConditionsValue(); break; case LATENT::SIGIL_REFRESH_BONUS: - expression = m_POwner->loc.zone->GetRegionID() >= REGION_TYPE::RONFAURE_FRONT && + expression = m_POwner->loc.zone != nullptr && + m_POwner->loc.zone->GetRegionID() >= REGION_TYPE::RONFAURE_FRONT && m_POwner->loc.zone->GetRegionID() <= REGION_TYPE::VALDEAUNIA_FRONT && ((float)m_POwner->health.mp / m_POwner->health.maxmp) * 100 < latentEffect.GetConditionsValue(); break;