Changeset - r28731:377f4b908032
[Not reviewed]
master
0 1 0
Peter Nelson - 3 months ago 2024-02-11 00:43:13
peter1138@openttd.org
Fix #12052: NewGRFs clearing industry cargo slots could fallback to default instead of empty. (#12053)

Ensure the default label is cleared when NewGRF sets a produced/accepted cargo slot, so that default fallback isn't used.
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/newgrf.cpp
Show inline comments
 
@@ -3787,12 +3787,13 @@ static ChangeInfoResult IndustriesChange
 
					if (i < num_cargoes) {
 
						CargoID cargo = GetCargoTranslation(buf->ReadByte(), _cur.grffile);
 
						indsp->produced_cargo[i] = cargo;
 
					} else {
 
						indsp->produced_cargo[i] = INVALID_CARGO;
 
					}
 
					indsp->produced_cargo_label[i] = CT_INVALID;
 
				}
 
				break;
 
			}
 

	
 
			case 0x26: { // variable length accepted cargoes
 
				byte num_cargoes = buf->ReadByte();
 
@@ -3805,12 +3806,13 @@ static ChangeInfoResult IndustriesChange
 
					if (i < num_cargoes) {
 
						CargoID cargo = GetCargoTranslation(buf->ReadByte(), _cur.grffile);
 
						indsp->accepts_cargo[i] = cargo;
 
					} else {
 
						indsp->accepts_cargo[i] = INVALID_CARGO;
 
					}
 
					indsp->accepts_cargo_label[i] = CT_INVALID;
 
				}
 
				break;
 
			}
 

	
 
			case 0x27: { // variable length production rates
 
				byte num_cargoes = buf->ReadByte();
0 comments (0 inline, 0 general)