From 6d3c2edc599c3f74cf1aa3e69ddb6d301af62fa0 Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sat, 11 Apr 2020 17:12:26 +0200 Subject: Add: [NewGRF] Industry behaviour flag to override second cargo production clamping for water industries when using smooth economy. Smooth economy is only used when the corresponding setting is enabled and the industries does not use the production callback. --- src/industry_cmd.cpp | 2 +- src/industrytype.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 35def4609..bd1d28ef6 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -2677,7 +2677,7 @@ static void ChangeIndustryProduction(Industry *i, bool monthly) /* Prevent production to overflow or Oil Rig passengers to be over-"produced" */ new_prod = Clamp(new_prod, 1, 255); - if (((indspec->behaviour & INDUSTRYBEH_BUILT_ONWATER) != 0) && j == 1) { + if (((indspec->behaviour & INDUSTRYBEH_BUILT_ONWATER) != 0) && j == 1 && !(indspec->behaviour & INDUSTRYBEH_WATER_NO_CLAMP_PROD)) { new_prod = Clamp(new_prod, 0, 16); } diff --git a/src/industrytype.h b/src/industrytype.h index ec4f8f85d..8af486c21 100644 --- a/src/industrytype.h +++ b/src/industrytype.h @@ -80,6 +80,7 @@ enum IndustryBehaviour { INDUSTRYBEH_NOBUILT_MAPCREATION = 1 << 16, ///< Do not force one instance of this type to appear on map generation INDUSTRYBEH_CANCLOSE_LASTINSTANCE = 1 << 17, ///< Allow closing down the last instance of this type INDUSTRYBEH_CARGOTYPES_UNLIMITED = 1 << 18, ///< Allow produced/accepted cargoes callbacks to supply more than 2 and 3 types + INDUSTRYBEH_WATER_NO_CLAMP_PROD = 1 << 19, ///< Do not clamp production of second cargo for water industries }; DECLARE_ENUM_AS_BIT_SET(IndustryBehaviour) -- cgit v1.2.3-70-g09d2