aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/GameManager.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-01-22 21:18:53 +0100
committer GitHub <noreply@github.com>2024-01-22 21:18:53 +0100
commit10f1f250883529e809d18a369f3668cfacd3bfd1 (patch)
tree7cd8a379963af18c24f8dabfe7525b39f2333e0c /src/openvic-simulation/GameManager.cpp
parent8205732a1b95f018f0898a2a4bc62e22f5bee0d3 (diff)
parentcaa2f31d536f568e485f15537db5e2f79f7616d5 (diff)
Merge pull request #135 from OpenVicProject/misc-changes
Miscellaneous bug fixes and format cleanup
Diffstat (limited to 'src/openvic-simulation/GameManager.cpp')
-rw-r--r--src/openvic-simulation/GameManager.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/openvic-simulation/GameManager.cpp b/src/openvic-simulation/GameManager.cpp
index 6435f05..a4cb5f4 100644
--- a/src/openvic-simulation/GameManager.cpp
+++ b/src/openvic-simulation/GameManager.cpp
@@ -195,10 +195,14 @@ bool GameManager::load_hardcoded_defines() {
// TODO - explore non-linear scaling to have more variation among non-massive provinces
// TODO - when selecting a province, only show the population of provinces controlled (or owned?)
// by the same country, relative to the most populous province in that set of provinces
- const colour_argb_t::value_type val = colour_argb_t::colour_traits::component_from_fraction(
- province.get_total_population(), map.get_highest_province_population() + 1, 0.1f, 1.0f
- );
- return colour_argb_t { 0, val, 0, ALPHA_VALUE };
+ if (!province.is_water()) {
+ const colour_argb_t::value_type val = colour_argb_t::colour_traits::component_from_fraction(
+ province.get_total_population(), map.get_highest_province_population() + 1, 0.1f, 1.0f
+ );
+ return colour_argb_t { 0, val, 0, ALPHA_VALUE };
+ } else {
+ return colour_argb_t::null();
+ }
}
},
{