Fix b0e73277: cargodist information got lost when splitting of cargo (#11280)

During b0e73277 we removed loaded_at_xy, but I kinda forgot that
it was a union with next_station. Now next_station wasn't copied
anymore, or checked in AreMergable.

(cherry picked from commit e6c02ebee6)
This commit is contained in:
Patric Stout
2023-09-10 15:20:58 +02:00
committed by Jonathan G Rennison
parent e5673a1756
commit f5d685a525
5 changed files with 12 additions and 8 deletions

View File

@@ -79,8 +79,8 @@ public:
static const uint16 MAX_COUNT = UINT16_MAX;
CargoPacket();
CargoPacket(StationID first_station, TileIndex source_xy, uint16 count, SourceType source_type, SourceID source_id);
CargoPacket(uint16 count, uint16 periods_in_transit, StationID source, TileIndex source_xy, Money feeder_share = 0, SourceType source_type = SourceType::Industry, SourceID source_id = INVALID_SOURCE);
CargoPacket(StationID first_station, TileIndex source_xy, uint16_t count, SourceType source_type, SourceID source_id);
CargoPacket(uint16_t count, uint16_t periods_in_transit, StationID first_station, StationID next_station, TileIndex source_xy, Money feeder_share = 0, SourceType source_type = SourceType::Industry, SourceID source_id = INVALID_SOURCE);
~CargoPacket();
CargoPacket *Split(uint new_size);
@@ -470,6 +470,7 @@ public:
{
return cp1->source_xy == cp2->source_xy &&
cp1->periods_in_transit == cp2->periods_in_transit &&
cp1->next_station == cp2->next_station &&
cp1->source_type == cp2->source_type &&
cp1->source_id == cp2->source_id;
}
@@ -604,6 +605,7 @@ public:
{
return cp1->source_xy == cp2->source_xy &&
cp1->periods_in_transit == cp2->periods_in_transit &&
cp1->next_station == cp2->next_station &&
cp1->source_type == cp2->source_type &&
cp1->source_id == cp2->source_id;
}