Skip to content

Commit f026d88

Browse files
committed
Add correct default values
1 parent 2b989ff commit f026d88

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libs/s25main/ingameWindows/iwDistribution.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,10 @@ void iwDistribution::TransmitSettings()
7979
if(settings_changed)
8080
{
8181
// Read values from the progress ctrls to the struct
82-
Distributions newDistribution{0};
82+
Distributions newDistribution;
83+
// Set default values for all distributions because groups with only one entry are not shown and will not be set
84+
std::transform(distributionMap.begin(), distributionMap.end(), newDistribution.begin(),
85+
[](DistributionMapping const& mapping) { return std::get<2>(mapping); });
8386

8487
for(unsigned i = 0; i < groups.size(); ++i)
8588
{

0 commit comments

Comments
 (0)