(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
This commit is contained in:
bjarni
2005-11-08 23:18:09 +00:00
parent df6c48fdba
commit 1b3e626ff9
4 changed files with 17 additions and 8 deletions

View File

@@ -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;
}