diff options
-rw-r--r-- | train.h | 1 | ||||
-rw-r--r-- | train_cmd.c | 2 | ||||
-rw-r--r-- | train_gui.c | 4 |
3 files changed, 4 insertions, 3 deletions
@@ -217,6 +217,7 @@ static inline Vehicle *GetNextVehicle(const Vehicle *v) void ConvertOldMultiheadToNew(void); void ConnectMultiheadedTrains(void); +uint CountArticulatedParts(EngineID engine_type); int CheckTrainInDepot(const Vehicle *v, bool needs_to_be_stopped); void CcCloneTrain(bool success, TileIndex tile, uint32 p1, uint32 p2); diff --git a/train_cmd.c b/train_cmd.c index e1c0ac017..c0727abd6 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -480,7 +480,7 @@ void DrawTrainEngine(int x, int y, EngineID engine, uint32 image_ormod) DrawSprite(image | image_ormod, x, y); } -static uint CountArticulatedParts(EngineID engine_type) +uint CountArticulatedParts(EngineID engine_type) { uint16 callback; uint i; diff --git a/train_gui.c b/train_gui.c index 57b824835..470633688 100644 --- a/train_gui.c +++ b/train_gui.c @@ -66,7 +66,7 @@ void DrawTrainEnginePurchaseInfo(int x, int y, EngineID engine_number) SetDParam(2, STR_EMPTY); if (rvi->capacity != 0) { SetDParam(0, _cargoc.names_long[rvi->cargo_type]); - SetDParam(1, rvi->capacity << multihead); + SetDParam(1, (rvi->capacity * (CountArticulatedParts(engine_number) + 1)) << multihead); SetDParam(2, STR_9842_REFITTABLE); } DrawString(x,y, STR_PURCHASE_INFO_CAPACITY, 0); @@ -114,7 +114,7 @@ void DrawTrainWagonPurchaseInfo(int x, int y, EngineID engine_number) SetDParam(2, STR_EMPTY); if (rvi->capacity != 0) { SetDParam(0, _cargoc.names_long[rvi->cargo_type]); - SetDParam(1, rvi->capacity); + SetDParam(1, rvi->capacity * (CountArticulatedParts(engine_number) + 1)); SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY); } DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, 0); |