From b3d048dfcf607cdc9f041b3913cb9932b492d539 Mon Sep 17 00:00:00 2001 From: frosch Date: Mon, 18 Jan 2021 22:42:10 +0100 Subject: [PATCH] Change: [NewGRF] industry special flag 19 now specifically targets only passenger production, instead of the second cargo of any water-based industry. (#8590) This behavior is less surprising to NewGRF authors, and may even be intentional behavior for some industries. --- src/industry_cmd.cpp | 3 +-- src/industrytype.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 8696e34400..69d67b9d8c 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -2754,8 +2754,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 && !(indspec->behaviour & INDUSTRYBEH_WATER_NO_CLAMP_PROD)) { + if (i->produced_cargo[j] == CT_PASSENGERS && !(indspec->behaviour & INDUSTRYBEH_NO_PAX_PROD_CLAMP)) { new_prod = Clamp(new_prod, 0, 16); } diff --git a/src/industrytype.h b/src/industrytype.h index 937ff62cb9..d5f1ba96a7 100644 --- a/src/industrytype.h +++ b/src/industrytype.h @@ -80,7 +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 + INDUSTRYBEH_NO_PAX_PROD_CLAMP = 1 << 19, ///< Do not clamp production of passengers. (smooth economy only) }; DECLARE_ENUM_AS_BIT_SET(IndustryBehaviour)