mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-24 03:56:43 +00:00
Codechange: replace 'new PoolItem(...' with 'PoolItem::Create(...'
This commit is contained in:
@@ -399,7 +399,7 @@ public:
|
||||
if (IsSavegameVersionBefore(SLV_161) && !IsSavegameVersionBefore(SLV_145) && st->facilities.Test(StationFacility::Airport)) {
|
||||
/* Store the old persistent storage. The GRFID will be added later. */
|
||||
assert(PersistentStorage::CanAllocateItem());
|
||||
st->airport.psa = new PersistentStorage(0, GSF_INVALID, TileIndex{});
|
||||
st->airport.psa = PersistentStorage::Create(0, GSF_INVALID, TileIndex{});
|
||||
std::copy(std::begin(_old_st_persistent_storage.storage), std::end(_old_st_persistent_storage.storage), std::begin(st->airport.psa->storage));
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@ public:
|
||||
assert(CargoPacket::CanAllocateItem());
|
||||
|
||||
/* Don't construct the packet with station here, because that'll fail with old savegames */
|
||||
CargoPacket *cp = new CargoPacket(GB(_waiting_acceptance, 0, 12), _cargo_periods, source, TileIndex{_cargo_source_xy}, _cargo_feeder_share);
|
||||
CargoPacket *cp = CargoPacket::Create(GB(_waiting_acceptance, 0, 12), _cargo_periods, source, TileIndex{_cargo_source_xy}, _cargo_feeder_share);
|
||||
ge.GetOrCreateData().cargo.Append(cp, StationID::Invalid());
|
||||
ge.status.Set(GoodsEntry::State::Rating);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user