From ae30ad7802f70fe06710780c26d53d2a5bc054dc Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Mon, 5 Feb 2024 23:12:56 +0000 Subject: [PATCH] Fix #12001: Use correct valid cargo check for old-style NewGRF town house 3rd cargo set up. (#12006) --- src/newgrf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/newgrf.cpp b/src/newgrf.cpp index b8c6ec0a75..ffc16c067a 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -2431,7 +2431,7 @@ static ChangeInfoResult TownHouseChangeInfo(uint hid, int numinfo, int prop, Byt * in the temperate climate. */ CargoID cid = housespec->accepts_cargo[2]; if (!IsValidCargoID(cid)) cid = GetCargoIDByLabel(housespec->accepts_cargo_label[2]); - if (!IsValidCargoID(cid) || !CargoSpec::Get(cid)->IsValid()) { + if (!IsValidCargoID(cid)) { housespec->cargo_acceptance[2] = 0; } } @@ -2471,7 +2471,7 @@ static ChangeInfoResult TownHouseChangeInfo(uint hid, int numinfo, int prop, Byt ((_settings_game.game_creation.landscape == LT_TOYLAND) ? GetCargoIDByLabel(CT_FIZZY_DRINKS) : GetCargoIDByLabel(CT_FOOD)); /* Make sure the cargo type is valid in this climate. */ - if (!CargoSpec::Get(cid)->IsValid()) goods = 0; + if (!IsValidCargoID(cid)) goods = 0; housespec->accepts_cargo[2] = cid; housespec->accepts_cargo_label[2] = CT_INVALID;