(svn r4610) - If a wagon has a capacity of 0 (zero), display it in the purchase list as N/A.
authorpeter1138
Fri, 28 Apr 2006 19:56:18 +0000
changeset 3685 7d2d1fee14d7
parent 3684 c5dfac322f16
child 3686 55efe6da4dfb
(svn r4610) - If a wagon has a capacity of 0 (zero), display it in the purchase list as N/A.
train_gui.c
--- a/train_gui.c	Fri Apr 28 19:49:48 2006 +0000
+++ b/train_gui.c	Fri Apr 28 19:56:18 2006 +0000
@@ -109,10 +109,14 @@
 	DrawString(x, y, STR_PURCHASE_INFO_WEIGHT_CWEIGHT, 0);
 	y += 10;
 
-	/* Cargo type + capacity */
-	SetDParam(0, _cargoc.names_long[rvi->cargo_type]);
-	SetDParam(1, rvi->capacity);
-	SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY);
+	/* Cargo type + capacity, or N/A */
+	SetDParam(0, STR_8838_N_A);
+	SetDParam(2, STR_EMPTY);
+	if (rvi->capacity != 0) {
+		SetDParam(0, _cargoc.names_long[rvi->cargo_type]);
+		SetDParam(1, rvi->capacity);
+		SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY);
+	}
 	DrawString(x, y, STR_PURCHASE_INFO_CAPACITY, 0);
 	y += 10;