Skip to content

Commit

Permalink
Fix null pointer crash in Community Patch only
Browse files Browse the repository at this point in the history
  • Loading branch information
RecursiveVision committed Jul 10, 2024
1 parent bfa6e19 commit fa5568e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions CvGameCoreDLL_Expansion2/CvDiplomacyAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18434,7 +18434,7 @@ void CvDiplomacyAI::SelectBestApproachTowardsMajorCiv(PlayerTypes ePlayer, bool
}
}
}
else
else if (pReligion)
{
eController = pReligion->m_eFounder;
}
Expand Down Expand Up @@ -47809,6 +47809,7 @@ int CvDiplomacyAI::GetReligionScore(PlayerTypes ePlayer)
// Someone else's?
else
{
// Who controls the Holy City?
PlayerTypes eController = NO_PLAYER;
const CvReligion* pReligion = GC.getGame().GetGameReligions()->GetReligion(eTheirStateReligion, NO_PLAYER);
if (MOD_BALANCE_VP)
Expand All @@ -47822,7 +47823,7 @@ int CvDiplomacyAI::GetReligionScore(PlayerTypes ePlayer)
}
}
}
else
else if (pReligion)
{
eController = pReligion->m_eFounder;
}
Expand Down
2 changes: 1 addition & 1 deletion CvGameCoreDLL_Expansion2/CvReligionClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11721,7 +11721,7 @@ bool CvReligionAIHelpers::PassesTeammateReligionCheck(ReligionTypes eReligion, P
}
}
}
else
else if (pReligion)
{
eController = pReligion->m_eFounder;
}
Expand Down

0 comments on commit fa5568e

Please sign in to comment.