diff options
author | bjarni <bjarni@openttd.org> | 2005-11-08 23:18:09 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2005-11-08 23:18:09 +0000 |
commit | 1b3e626ff93738d4e549833d43f9f7fba7a70a43 (patch) | |
tree | 285ee5a9f639c628b2201866501b9654709c0787 /ship_cmd.c | |
parent | df6c48fdba7933e30a16c82e69d8d57ab9515e6d (diff) | |
download | openttd-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 'ship_cmd.c')
-rw-r--r-- | ship_cmd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ship_cmd.c b/ship_cmd.c index e0e099009..887fd70d2 100644 --- a/ship_cmd.c +++ b/ship_cmd.c @@ -921,7 +921,8 @@ int32 CmdBuildShip(int x, int y, uint32 flags, uint32 p1, uint32 p2) InvalidateWindow(WC_VEHICLE_DEPOT, v->tile); RebuildVehicleLists(); InvalidateWindow(WC_COMPANY, v->owner); - InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Ship); // updates the replace Ship window + if (IsLocalPlayer()) + InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Ship); // updates the replace Ship window } return value; @@ -953,7 +954,8 @@ int32 CmdSellShip(int x, int y, uint32 flags, uint32 p1, uint32 p2) InvalidateWindow(WC_COMPANY, v->owner); DeleteWindowById(WC_VEHICLE_VIEW, v->index); DeleteVehicle(v); - InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Ship); // updates the replace Ship window + if (IsLocalPlayer()) + InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Ship); // updates the replace Ship window } return -(int32)v->value; |