Skip to content

Commit

Permalink
GOTTA, SWEEP SWEEP SWEEP!
Browse files Browse the repository at this point in the history
  • Loading branch information
RecursiveVision committed Jun 29, 2024
1 parent 63dcfae commit b058328
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CvGameCoreDLL_Expansion2/CvCityCitizens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2099,7 +2099,7 @@ void CvCityCitizens::DoAlterWorkingPlot(int iIndex)

if (pPlot != NULL)
{
// can't work the the center tile of another city
// can't work the center tile of another city
if (pPlot->isCity())
return;

Expand Down
8 changes: 4 additions & 4 deletions CvGameCoreDLL_Expansion2/CvCultureClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4876,15 +4876,12 @@ int CvPlayerCulture::GetTourismModifierSharedReligion(PlayerTypes eTargetPlayer)
if (eMyReligion <= RELIGION_PANTHEON || eTargetPlayer == NO_PLAYER)
return 0;

int iModifier = /*25in CP, 1 in VP*/ GD_INT_GET(TOURISM_MODIFIER_SHARED_RELIGION);
int iModifier = /*25 in CP, 1 in VP*/ GD_INT_GET(TOURISM_MODIFIER_SHARED_RELIGION);
int iModifierMax = /*0 in CP, 50 in VP*/ GD_INT_GET(TOURISM_MODIFIER_SHARED_RELIGION_MAX);
int iMultiplier = m_pPlayer->GetPlayerPolicies()->GetNumericModifier(POLICYMOD_SHARED_RELIGION_TOURISM_MODIFIER) + m_pPlayer->GetPlayerTraits()->GetSharedReligionTourismModifier();

switch (/*0 in CP, 2 in VP*/ GD_INT_GET(TOURISM_MODIFIER_SHARED_RELIGION_TYPE))
{
case 0:
// Flat value if both players have the same religion
return GET_PLAYER(eTargetPlayer).GetReligions()->GetStateReligion() == eMyReligion ? iModifier + iMultiplier : 0;
case 1:
// Scales with number of cities following religion
iModifier *= GC.getGame().GetGameReligions()->GetNumDomesticCitiesFollowing(eMyReligion, eTargetPlayer);
Expand All @@ -4895,6 +4892,9 @@ int CvPlayerCulture::GetTourismModifierSharedReligion(PlayerTypes eTargetPlayer)
int iPopulation = GET_PLAYER(eTargetPlayer).getTotalPopulation();
iModifier = iModifier * 100 * iFollowers / iPopulation;
break;
default:
// Flat value if both players have the same religion
return GET_PLAYER(eTargetPlayer).GetReligions()->GetStateReligion() == eMyReligion ? iModifier + iMultiplier : 0;
}

if (iModifierMax > 0)
Expand Down
4 changes: 2 additions & 2 deletions CvGameCoreDLL_Expansion2/CvGlobals.h
Original file line number Diff line number Diff line change
Expand Up @@ -2773,8 +2773,8 @@ class CvGlobals
GD_INT_MEMBER(BASE_CULTURE_PER_GREAT_WORK);
GD_INT_MEMBER(BASE_TOURISM_PER_GREAT_WORK);
GD_INT_MEMBER(TOURISM_MODIFIER_SHARED_RELIGION);
GD_INT_MEMBER(TOURISM_MODIFIER_SHARED_RELIGION_MAX);
GD_INT_MEMBER(TOURISM_MODIFIER_SHARED_RELIGION_TYPE);
GD_INT_MEMBER(TOURISM_MODIFIER_SHARED_RELIGION_MAX); // VP
GD_INT_MEMBER(TOURISM_MODIFIER_SHARED_RELIGION_TYPE); // VP
GD_INT_MEMBER(TOURISM_MODIFIER_TRADE_ROUTE);
GD_INT_MEMBER(TOURISM_MODIFIER_OPEN_BORDERS);
GD_INT_MEMBER(TOURISM_MODIFIER_DIFFERENT_IDEOLOGIES);
Expand Down

2 comments on commit b058328

@JohnsterID
Copy link
Contributor

@JohnsterID JohnsterID commented on b058328 Jun 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RecursiveVision, build failed.
https://github.com/LoneGazebo/Community-Patch-DLL/actions/runs/9726268100/job/26844539656

1>CvCultureClasses.cpp(4895): error C2361: initialization of 'iPopulation' is skipped by 'default' label
1>        CvCultureClasses.cpp(4892) : see declaration of 'iPopulation'
1>CvCultureClasses.cpp(4895): error C2361: initialization of 'iFollowers' is skipped by 'default' label
1>        CvCultureClasses.cpp(4891) : see declaration of 'iFollowers'
==== D:\a\Community-Patch-DLL\Community-Patch-DLL\CvGameCoreDLL_Expansion2\CvCultureClasses.cpp ====
D:\a\Community-Patch-DLL\Community-Patch-DLL\CvGameCoreDLL_Expansion2\CvCultureClasses.cpp(4895,2) : error: cannot jump from switch statement to this case label
 4895 |                 default:
      |                 ^
D:\a\Community-Patch-DLL\Community-Patch-DLL\CvGameCoreDLL_Expansion2\CvCultureClasses.cpp(4892,7) : note: jump bypasses variable initialization
 4892 |                         int iPopulation = GET_PLAYER(eTargetPlayer).getTotalPopulation();
      |                             ^
D:\a\Community-Patch-DLL\Community-Patch-DLL\CvGameCoreDLL_Expansion2\CvCultureClasses.cpp(4891,7) : note: jump bypasses variable initialization
 4891 |                         int iFollowers = GC.getGame().GetGameReligions()->GetNumFollowers(eMyReligion, eTargetPlayer);
      |                             ^
1 error generated.

@RecursiveVision
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Please sign in to comment.