diff --git a/src/economy.cpp b/src/economy.cpp --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1093,6 +1093,10 @@ void PrepareUnload(Vehicle *front_v) } assert(front_v->cargo_payment == NULL); + /* One CargoPayment per vehicle and the vehicle limit equals the + * limit in number of CargoPayments. Can't go wrong. */ + assert_compile(CargoPaymentPool::MAX_SIZE == VehiclePool::MAX_SIZE); + assert(CargoPayment::CanAllocateItem()); front_v->cargo_payment = new CargoPayment(front_v); }