mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-18 18:02:37 +01:00
CargoPayment required cargo type to be set as state via SetCargo(). This was error prone as CargoPayment is per consist but cargo type can vary per vehicle part. Additionally if SetCargo was not called then the default "uninitialised" state was cargo slot 0, passengers. Instead of trying to make sure it is set correctly, remove cargo type from CargoPayment and always pass it explicitly to the PayTransfer/PayFinalDelivery methods.
This commit is contained in:
@@ -107,7 +107,7 @@ bool CargoDelivery::operator()(CargoPacket *cp)
|
||||
{
|
||||
uint remove = this->Preprocess(cp);
|
||||
this->source->RemoveFromMeta(cp, VehicleCargoList::MTA_DELIVER, remove);
|
||||
this->payment->PayFinalDelivery(cp, remove, this->current_tile);
|
||||
this->payment->PayFinalDelivery(this->cargo, cp, remove, this->current_tile);
|
||||
return this->Postprocess(cp, remove);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user