From 117821ead319ddbb9cac94a6ce5b99f535401938 Mon Sep 17 00:00:00 2001 From: RecursiveVision <66801010+RecursiveVision@users.noreply.github.com> Date: Fri, 6 Dec 2024 10:12:15 -0500 Subject: [PATCH] Fix minor UI annoyance --- CvGameCoreDLL_Expansion2/CvPlayer.cpp | 2 +- CvGameCoreDLL_Expansion2/Lua/CvLuaPlayer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CvGameCoreDLL_Expansion2/CvPlayer.cpp b/CvGameCoreDLL_Expansion2/CvPlayer.cpp index 76f4cd05a1..052d521df1 100644 --- a/CvGameCoreDLL_Expansion2/CvPlayer.cpp +++ b/CvGameCoreDLL_Expansion2/CvPlayer.cpp @@ -16335,7 +16335,7 @@ int CvPlayer::GetNumUnitsSupplied(bool bCheckWarWeariness) const iUnitSupply += GetNumUnitsSuppliedByPopulation(); iUnitSupply += GetUnitSupplyFromExpendedGreatPeople(); - int iEmpireSizeReduction = max(GetNumEffectiveCities() * /*0 in CP, 5 in VP*/ GC.getMap().getWorldInfo().GetNumCitiesUnitSupplyMod(), 0); + int iEmpireSizeReduction = getNumCities() > 0 ? max(GetNumEffectiveCities(false) * /*0 in CP, 5 in VP*/ GC.getMap().getWorldInfo().GetNumCitiesUnitSupplyMod(), 0) : 0; iUnitSupply *= 100; iUnitSupply /= (100 + iEmpireSizeReduction); diff --git a/CvGameCoreDLL_Expansion2/Lua/CvLuaPlayer.cpp b/CvGameCoreDLL_Expansion2/Lua/CvLuaPlayer.cpp index f437f01399..7b76485f5d 100644 --- a/CvGameCoreDLL_Expansion2/Lua/CvLuaPlayer.cpp +++ b/CvGameCoreDLL_Expansion2/Lua/CvLuaPlayer.cpp @@ -4587,7 +4587,7 @@ int CvLuaPlayer::lGetTechSupplyReduction(lua_State* L) int CvLuaPlayer::lGetEmpireSizeSupplyReduction(lua_State* L) { CvPlayerAI* pkPlayer = GetInstance(L); - int iReductionPercent = max(pkPlayer->GetNumEffectiveCities(false) * /*0 in CP, 5 in VP*/ GC.getMap().getWorldInfo().GetNumCitiesUnitSupplyMod(), 0); + int iReductionPercent = pkPlayer->getNumCities() > 0 ? max(pkPlayer->GetNumEffectiveCities(false) * /*0 in CP, 5 in VP*/ GC.getMap().getWorldInfo().GetNumCitiesUnitSupplyMod(), 0) : 0; if (iReductionPercent == 0) { lua_pushinteger(L, 0);