Skip to content

Commit

Permalink
Null check for influence buff latents
Browse files Browse the repository at this point in the history
  • Loading branch information
MowFord committed Dec 10, 2023
1 parent d9d4358 commit f3a2696
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/map/latent_effect_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f3a2696

Please sign in to comment.