summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-01-23 21:24:26 +0000
committerbjarni <bjarni@openttd.org>2007-01-23 21:24:26 +0000
commita73f67af40ea1d6028a3ec244f0dd9ee25786b64 (patch)
tree01f17f2aee34d3bc55df1ba26ccf0e3c9423a939 /src
parentd2ca1494bef4df61788bd48e2407be3dcf4c6166 (diff)
downloadopenttd-a73f67af40ea1d6028a3ec244f0dd9ee25786b64.tar.xz
(svn r8381) -Fix (r8377): [build vehicle window] cleaned up the train refitable detection. It had two variables doing the same thing, but not always set to the same (oops)
Diffstat (limited to 'src')
-rw-r--r--src/build_vehicle_gui.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp
index 54c3e2b35..b352d06ff 100644
--- a/src/build_vehicle_gui.cpp
+++ b/src/build_vehicle_gui.cpp
@@ -535,12 +535,12 @@ void DrawVehiclePurchaseInfo(int x, int y, uint w, EngineID engine_number)
case VEH_Train: {
const RailVehicleInfo *rvi = RailVehInfo(engine_number);
+ refitable = (EngInfo(engine_number)->refit_mask != 0) && (rvi->capacity > 0);
+
if (rvi->flags & RVI_WAGON) {
y = DrawRailWagonPurchaseInfo(x, y, engine_number, rvi);
- refitable = true;
} else {
y = DrawRailEnginePurchaseInfo(x, y, engine_number, rvi, e);
- refitable = (rvi->capacity > 0);
}
/* Cargo type + capacity, or N/A */
@@ -549,11 +549,10 @@ void DrawVehiclePurchaseInfo(int x, int y, uint w, EngineID engine_number)
SetDParam(2, STR_EMPTY);
} else {
int multihead = (rvi->flags & RVI_MULTIHEAD ? 1 : 0);
- bool refittable = (EngInfo(engine_number)->refit_mask != 0);
SetDParam(0, rvi->cargo_type);
SetDParam(1, (rvi->capacity * (CountArticulatedParts(engine_number) + 1)) << multihead);
- SetDParam(2, refittable ? STR_9842_REFITTABLE : STR_EMPTY);
+ SetDParam(2, refitable ? STR_9842_REFITTABLE : STR_EMPTY);
}
DrawString(x,y, STR_PURCHASE_INFO_CAPACITY, 0);
y += 10;