summaryrefslogtreecommitdiff
path: root/train_gui.c
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-10-20 19:48:25 +0000
committerpeter1138 <peter1138@openttd.org>2006-10-20 19:48:25 +0000
commit53f8e99169f77cff88060cc634bd5f651dec1a5f (patch)
tree48fd84eccf2c748dcfa67f2c508ad836d3d47088 /train_gui.c
parentaf89d9333bc72ab1d5e0ab546bc3d10e8f7237e3 (diff)
downloadopenttd-53f8e99169f77cff88060cc634bd5f651dec1a5f.tar.xz
(svn r6858) - Fix (r6855): Handle rail vehicles with no capacity (N/A) by setting cargo type to CT_INVALID and handling it later. STR_8838_N_A is not a valid cargo type...
Diffstat (limited to 'train_gui.c')
-rw-r--r--train_gui.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/train_gui.c b/train_gui.c
index e89dec050..fc02c6792 100644
--- a/train_gui.c
+++ b/train_gui.c
@@ -269,9 +269,10 @@ void DrawTrainEnginePurchaseInfo(int x, int y, EngineID engine_number)
};
/* Cargo type + capacity, or N/A */
- SetDParam(0, STR_8838_N_A);
- SetDParam(2, STR_EMPTY);
- if (rvi->capacity != 0) {
+ if (rvi->capacity == 0) {
+ SetDParam(0, CT_INVALID);
+ SetDParam(2, STR_EMPTY);
+ } else {
SetDParam(0, rvi->cargo_type);
SetDParam(1, (rvi->capacity * (CountArticulatedParts(engine_number) + 1)) << multihead);
SetDParam(2, STR_9842_REFITTABLE);
@@ -317,9 +318,10 @@ void DrawTrainWagonPurchaseInfo(int x, int y, EngineID engine_number)
y += 10;
/* Cargo type + capacity, or N/A */
- SetDParam(0, STR_8838_N_A);
- SetDParam(2, STR_EMPTY);
- if (rvi->capacity != 0) {
+ if (rvi->capacity == 0) {
+ SetDParam(0, CT_INVALID);
+ SetDParam(2, STR_EMPTY);
+ } else {
SetDParam(0, rvi->cargo_type);
SetDParam(1, rvi->capacity * (CountArticulatedParts(engine_number) + 1));
SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY);