summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-05-17 23:08:21 +0000
committerDarkvater <darkvater@openttd.org>2005-05-17 23:08:21 +0000
commit9fb4b2ef5558d316e8f684a43f8df24ee6303d37 (patch)
tree8e765308ad6930f3fbd435ebd1dc58e6e3393ba7
parent70e2e79c45488624a40e1b6329d45f0ba614ea4f (diff)
downloadopenttd-9fb4b2ef5558d316e8f684a43f8df24ee6303d37.tar.xz
(svn r2347) - Fix (regression): depot window did not get redrawn when a non-train-engine was sold.
-rw-r--r--train_cmd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/train_cmd.c b/train_cmd.c
index 95770e442..4539e83f2 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -932,9 +932,11 @@ int32 CmdSellRailWagon(int x, int y, uint32 flags, uint32 p1, uint32 p2)
// make sure the vehicle is stopped in the depot
if (CheckTrainStoppedInDepot(first) < 0) return CMD_ERROR;
- if ((flags & DC_EXEC) && v == first && first->subtype == TS_Front_Engine) {
- DeleteWindowById(WC_VEHICLE_VIEW, first->index);
- InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Train);
+ if (flags & DC_EXEC) {
+ if (v == first && first->subtype == TS_Front_Engine) {
+ DeleteWindowById(WC_VEHICLE_VIEW, first->index);
+ InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Train);
+ }
InvalidateWindow(WC_VEHICLE_DEPOT, first->tile);
RebuildVehicleLists();
}