Skip to content

Commit

Permalink
Merge pull request #4844 from CatsAndBoats/sanction_latent
Browse files Browse the repository at this point in the history
[CPP] Null check for influence buff latent effects
  • Loading branch information
zach2good authored Dec 10, 2023
2 parents f0d3b4d + f3a2696 commit cb31c60
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 @@ -718,25 +718,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 cb31c60

Please sign in to comment.