summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2005-11-08 23:18:09 +0000
committerbjarni <bjarni@openttd.org>2005-11-08 23:18:09 +0000
commit1b3e626ff93738d4e549833d43f9f7fba7a70a43 (patch)
tree285ee5a9f639c628b2201866501b9654709c0787 /train_cmd.c
parentdf6c48fdba7933e30a16c82e69d8d57ab9515e6d (diff)
downloadopenttd-1b3e626ff93738d4e549833d43f9f7fba7a70a43.tar.xz
(svn r3156) -Fix: removed some cases where autoreplace windows were redrawn when nothing was changed
due to the FOR_ALL_VEHICLES(), redrawing those windows are slow
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/train_cmd.c b/train_cmd.c
index e5daaf014..71013483d 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -773,12 +773,13 @@ int32 CmdBuildRailVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
InvalidateWindow(WC_VEHICLE_DEPOT, tile);
RebuildVehicleLists();
InvalidateWindow(WC_COMPANY, v->owner);
+ if (IsLocalPlayer()) {
+ InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Train); // updates the replace Train window
+ }
}
}
_cmd_build_rail_veh_score = _railveh_score[p1];
- InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Train); // updates the replace Train window
-
return value;
}
@@ -1128,6 +1129,8 @@ int32 CmdSellRailWagon(int x, int y, uint32 flags, uint32 p1, uint32 p2)
if (flags & DC_EXEC) {
if (v == first && first->subtype == TS_Front_Engine) {
DeleteWindowById(WC_VEHICLE_VIEW, first->index);
+ }
+ if (IsLocalPlayer() && (p1 == 1 || !(RailVehInfo(v->engine_type)->flags & RVI_WAGON))) {
InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Train);
}
InvalidateWindow(WC_VEHICLE_DEPOT, first->tile);