summaryrefslogtreecommitdiff
path: root/roadveh_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
commit5e278b7ec3adfa6f0b65f3cff5769943166bef22 (patch)
tree285ee5a9f639c628b2201866501b9654709c0787 /roadveh_cmd.c
parent5481dcd191a1b763330345d11264de6eac91a106 (diff)
downloadopenttd-5e278b7ec3adfa6f0b65f3cff5769943166bef22.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 'roadveh_cmd.c')
-rw-r--r--roadveh_cmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/roadveh_cmd.c b/roadveh_cmd.c
index 32a2fd25d..9ed41a694 100644
--- a/roadveh_cmd.c
+++ b/roadveh_cmd.c
@@ -193,7 +193,8 @@ int32 CmdBuildRoadVeh(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_Road); // updates the replace Road window
+ if (IsLocalPlayer())
+ InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Road); // updates the replace Road window
}
return cost;
@@ -263,8 +264,9 @@ int32 CmdSellRoadVeh(int x, int y, uint32 flags, uint32 p1, uint32 p2)
DeleteWindowById(WC_VEHICLE_VIEW, v->index);
ClearSlot(v, v->u.road.slot);
DeleteVehicle(v);
+ if (IsLocalPlayer())
+ InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Road); // updates the replace Road window
}
- InvalidateWindow(WC_REPLACE_VEHICLE, VEH_Road); // updates the replace Road window
return -(int32)v->value;
}