Skip to content

Commit

Permalink
Fix #9531
Browse files Browse the repository at this point in the history
  • Loading branch information
RecursiveVision committed Jul 7, 2024
1 parent beff6e2 commit 764915b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions (1) Community Patch/Core Files/Core Values/CoreDefines.sql
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ INSERT INTO Defines (Name, Value) SELECT 'TECH_NEED_MODIFIER_PER_TECH_BELOW_MEDI
INSERT INTO Defines (Name, Value) SELECT 'CITY_SIZE_NEED_MODIFIER', 0; -- Modifier to needs per citizen in the city. Disabled by default. -100 = -1%.
INSERT INTO Defines (Name, Value) SELECT 'EMPIRE_SIZE_NEED_MODIFIER_CITIES', 500; -- Modifier to needs per non-puppet city in the empire, excluding the capital. Scales with map size. Default is 500 (+5%). Does not support negative values.
INSERT INTO Defines (Name, Value) SELECT 'EMPIRE_SIZE_NEED_MODIFIER_POP', 125; -- Modifier to needs per citizen in the empire, excluding those in puppet cities. Scales with map size. Default is 125 (+1% per 8 citizens). Does not support negative values.
INSERT INTO Defines (Name, Value) SELECT 'EMPIRE_SIZE_NEED_MODIFIER_CAP', 100000; -- Cap to total Empire Size Modifier for Needs. (1 = 1%)

-- Unhappiness from Other Sources
INSERT INTO Defines (Name, Value) SELECT 'UNHAPPINESS_PER_STARVING_POP', 1.0; -- Unhappiness point per starving citizen. (rounded down)
Expand Down
2 changes: 1 addition & 1 deletion CvGameCoreDLL_Expansion2/CvCity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20658,7 +20658,7 @@ int CvCity::GetEmpireSizeModifier() const
iEmpireMod *= GET_PLAYER(getOwner()).isHuman() ? 100 + GET_PLAYER(getOwner()).getHandicapInfo().getEmpireSizeUnhappinessMod() : 100 + GET_PLAYER(getOwner()).getHandicapInfo().getEmpireSizeUnhappinessMod() + GC.getGame().getHandicapInfo().getAIEmpireSizeUnhappinessMod();
iEmpireMod /= 100;

return std::max(iEmpireMod, 0);
return range(iEmpireMod, 0, /*100000*/ GD_INT_GET(EMPIRE_SIZE_NEED_MODIFIER_CAP));
}

int CvCity::GetReducedEmpireSizeModifier(bool bForceRecalc, bool bCityOnly) const
Expand Down
2 changes: 2 additions & 0 deletions CvGameCoreDLL_Expansion2/CvGlobals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1497,6 +1497,7 @@ CvGlobals::CvGlobals() :
GD_INT_INIT(CITY_SIZE_NEED_MODIFIER, 0),
GD_INT_INIT(EMPIRE_SIZE_NEED_MODIFIER_CITIES, 500),
GD_INT_INIT(EMPIRE_SIZE_NEED_MODIFIER_POP, 125),
GD_INT_INIT(EMPIRE_SIZE_NEED_MODIFIER_CAP, 100000),
GD_INT_INIT(UNHAPPINESS_PER_SPECIALIST, 100),
GD_INT_INIT(UNHAPPINESS_PER_X_PUPPET_CITIZENS, 4),
GD_INT_INIT(WAR_WEARINESS_POPULATION_PERCENT_CAP, 34),
Expand Down Expand Up @@ -6329,6 +6330,7 @@ void CvGlobals::cacheGlobals()
GD_INT_CACHE(CITY_SIZE_NEED_MODIFIER);
GD_INT_CACHE(EMPIRE_SIZE_NEED_MODIFIER_CITIES);
GD_INT_CACHE(EMPIRE_SIZE_NEED_MODIFIER_POP);
GD_INT_CACHE(EMPIRE_SIZE_NEED_MODIFIER_CAP);
GD_INT_CACHE(UNHAPPINESS_PER_SPECIALIST);
GD_INT_CACHE(UNHAPPINESS_PER_X_PUPPET_CITIZENS);
GD_INT_CACHE(WAR_WEARINESS_POPULATION_PERCENT_CAP);
Expand Down
1 change: 1 addition & 0 deletions CvGameCoreDLL_Expansion2/CvGlobals.h
Original file line number Diff line number Diff line change
Expand Up @@ -2088,6 +2088,7 @@ class CvGlobals
GD_INT_MEMBER(CITY_SIZE_NEED_MODIFIER); // VP
GD_INT_MEMBER(EMPIRE_SIZE_NEED_MODIFIER_CITIES); // VP
GD_INT_MEMBER(EMPIRE_SIZE_NEED_MODIFIER_POP); // VP
GD_INT_MEMBER(EMPIRE_SIZE_NEED_MODIFIER_CAP); // VP
GD_INT_MEMBER(UNHAPPINESS_PER_SPECIALIST); // VP
GD_INT_MEMBER(UNHAPPINESS_PER_X_PUPPET_CITIZENS); // VP
GD_INT_MEMBER(WAR_WEARINESS_POPULATION_PERCENT_CAP); // VP
Expand Down

0 comments on commit 764915b

Please sign in to comment.