From 2fdc22e7ead4df17bde96954ccf6e7cf914bde45 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Mon, 11 Sep 2023 22:33:27 +0100 Subject: [PATCH] Codechange: Shuffle CargoPayment members to reduce padding. --- src/economy.cpp | 4 ++-- src/economy_base.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/economy.cpp b/src/economy.cpp index cb207ab441..caf0d2a4f5 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1188,8 +1188,8 @@ static void TriggerIndustryProduction(Industry *i) * @param front The front of the train */ CargoPayment::CargoPayment(Vehicle *front) : - front(front), - current_station(front->last_station_visited) + current_station(front->last_station_visited), + front(front) { } diff --git a/src/economy_base.h b/src/economy_base.h index a0aa97f142..4fbc11b24f 100644 --- a/src/economy_base.h +++ b/src/economy_base.h @@ -22,16 +22,16 @@ extern CargoPaymentPool _cargo_payment_pool; * Helper class to perform the cargo payment. */ struct CargoPayment : CargoPaymentPool::PoolItem<&_cargo_payment_pool> { + /* CargoPaymentID index member of CargoPaymentPool is 4 bytes. */ + StationID current_station; ///< NOSAVE: The current station + CargoID ct; ///< NOSAVE: The currently handled cargo type + Company *owner; ///< NOSAVE: The owner of the vehicle + Vehicle *front; ///< The front vehicle to do the payment of Money route_profit; ///< The amount of money to add/remove from the bank account Money visual_profit; ///< The visual profit to show Money visual_transfer; ///< The transfer credits to be shown - /* Unsaved variables */ - Company *owner; ///< The owner of the vehicle - StationID current_station; ///< The current station - CargoID ct; ///< The currently handled cargo type - /** Constructor for pool saveload */ CargoPayment() {} CargoPayment(Vehicle *front);