mirror of https://github.com/OpenTTD/OpenTTD
Fix #10627: Houses subsitute specs should only be copied on first definition.
Before #10627, substitue specs were always copied despite redefinition.pull/10720/head
parent
7535eb65e2
commit
64782cf005
|
@ -2387,9 +2387,9 @@ static ChangeInfoResult TownHouseChangeInfo(uint hid, int numinfo, int prop, Byt
|
||||||
|
|
||||||
/* Allocate space for this house. */
|
/* Allocate space for this house. */
|
||||||
if (housespec == nullptr) {
|
if (housespec == nullptr) {
|
||||||
|
/* Only the first property 08 setting copies properties; if you later change it, properties will stay. */
|
||||||
_cur.grffile->housespec[hid + i] = std::make_unique<HouseSpec>(*HouseSpec::Get(subs_id));
|
_cur.grffile->housespec[hid + i] = std::make_unique<HouseSpec>(*HouseSpec::Get(subs_id));
|
||||||
housespec = _cur.grffile->housespec[hid + i].get();
|
housespec = _cur.grffile->housespec[hid + i].get();
|
||||||
}
|
|
||||||
|
|
||||||
housespec->enabled = true;
|
housespec->enabled = true;
|
||||||
housespec->grf_prop.local_id = hid + i;
|
housespec->grf_prop.local_id = hid + i;
|
||||||
|
@ -2407,6 +2407,7 @@ static ChangeInfoResult TownHouseChangeInfo(uint hid, int numinfo, int prop, Byt
|
||||||
if (!CargoSpec::Get(housespec->accepts_cargo[2])->IsValid()) {
|
if (!CargoSpec::Get(housespec->accepts_cargo[2])->IsValid()) {
|
||||||
housespec->cargo_acceptance[2] = 0;
|
housespec->cargo_acceptance[2] = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue