Add wrappers to get and update the current effective day length factor

This commit is contained in:
Jonathan G Rennison
2024-02-09 19:39:58 +00:00
parent db8b77a72e
commit 516e8defb5
20 changed files with 66 additions and 42 deletions

View File

@@ -14,6 +14,7 @@
#include "../../command_type.h"
#include "../../command_func.h"
#include "../../economy_func.h"
#include "../../date_func.h"
#include <optional>
@@ -29,7 +30,7 @@ struct CargoScalingProxy {
uint64_t scale = this->is_industry ? _settings_game.economy.industry_cargo_scale : _settings_game.economy.town_cargo_scale;
CargoScalingMode mode = this->is_industry ? _settings_game.economy.industry_cargo_scale_mode : _settings_game.economy.town_cargo_scale_mode;
if (mode == CSM_DAYLENGTH) {
scale *= _settings_game.economy.day_length_factor;
scale *= DayLengthFactor();
}
return PercentageToScaleQuantityFactor(scale);
}