summaryrefslogtreecommitdiff
path: root/src/roadveh_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-01-26 17:31:44 +0000
committerrubidium <rubidium@openttd.org>2011-01-26 17:31:44 +0000
commit4fff63d790ab865cc93963d1939f27ee1c023ace (patch)
tree04fd8c3aeb35983dea8084dad2f14bcf91d4e305 /src/roadveh_cmd.cpp
parentb11f1bd4ed68fc0d031429df2925b87ed6baceb3 (diff)
downloadopenttd-4fff63d790ab865cc93963d1939f27ee1c023ace.tar.xz
(svn r21912) -Codechange: let road vehicles use gcache.last_speed/SetLastSpeed as well
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r--src/roadveh_cmd.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 036b7c200..c955fe87e 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -651,7 +651,6 @@ static void RoadVehArrivesAt(const RoadVehicle *v, Station *st)
*/
static int RoadVehAccelerate(RoadVehicle *v)
{
- uint oldspeed = v->cur_speed;
uint accel = v->overtaking != 0 ? 256 : 0;
accel += (_settings_game.vehicle.roadveh_acceleration_model == AM_ORIGINAL) ? 256 : v->GetAcceleration();
uint spd = v->subspeed + accel;
@@ -673,13 +672,6 @@ static int RoadVehAccelerate(RoadVehicle *v)
first->cur_speed = min(first->cur_speed, GetBridgeSpec(GetBridgeType(v->tile))->speed * 2);
}
- /* Update statusbar only if speed has changed to save CPU time */
- if (oldspeed != v->cur_speed) {
- if (_settings_client.gui.vehicle_speed) {
- SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
- }
- }
-
int scaled_spd = v->GetAdvanceSpeed(spd);
scaled_spd += v->progress;
@@ -1497,6 +1489,8 @@ static bool RoadVehController(RoadVehicle *v)
if (j >= adv_spd && RoadVehCheckTrainCrash(v)) break;
}
+ v->SetLastSpeed();
+
for (RoadVehicle *u = v; u != NULL; u = u->Next()) {
if ((u->vehstatus & VS_HIDDEN) != 0) continue;