(svn r6649) - Codechange: Show more correct capacity of articulated wagons in the train purchase list.
authorpeter1138
Thu, 05 Oct 2006 11:26:59 +0000
changeset 4737 287bc9b53ec9
parent 4736 56f9dcf1d133
child 4738 54cb3161b6f5
(svn r6649) - Codechange: Show more correct capacity of articulated wagons in the train purchase list.
train.h
train_cmd.c
train_gui.c
--- a/train.h	Thu Oct 05 08:39:16 2006 +0000
+++ b/train.h	Thu Oct 05 11:26:59 2006 +0000
@@ -217,6 +217,7 @@
 
 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);
--- a/train_cmd.c	Thu Oct 05 08:39:16 2006 +0000
+++ b/train_cmd.c	Thu Oct 05 11:26:59 2006 +0000
@@ -480,7 +480,7 @@
 	DrawSprite(image | image_ormod, x, y);
 }
 
-static uint CountArticulatedParts(EngineID engine_type)
+uint CountArticulatedParts(EngineID engine_type)
 {
 	uint16 callback;
 	uint i;
--- a/train_gui.c	Thu Oct 05 08:39:16 2006 +0000
+++ b/train_gui.c	Thu Oct 05 11:26:59 2006 +0000
@@ -66,7 +66,7 @@
 	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 @@
 	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);