diff options
author | truebrain <truebrain@openttd.org> | 2012-01-02 13:44:30 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2012-01-02 13:44:30 +0000 |
commit | 0d929e877faf9572a80803db382ab973702e02c0 (patch) | |
tree | f19cea6421726b0719b1cfc7c403a8ac6262bc60 /src/roadveh_cmd.cpp | |
parent | 19004a77f843fccd0850cc980dd2c80de6d81462 (diff) | |
download | openttd-0d929e877faf9572a80803db382ab973702e02c0.tar.xz |
(svn r23713) -Codechange: split VehicleMove() into two functions, to minimalize the work done where possible
Diffstat (limited to 'src/roadveh_cmd.cpp')
-rw-r--r-- | src/roadveh_cmd.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp index 96fdab63e..75eea8b45 100644 --- a/src/roadveh_cmd.cpp +++ b/src/roadveh_cmd.cpp @@ -300,7 +300,7 @@ CommandCost CmdBuildRoadVehicle(TileIndex tile, DoCommandFlag flags, const Engin /* Initialize cached values for realistic acceleration. */ if (_settings_game.vehicle.roadveh_acceleration_model != AM_ORIGINAL) v->CargoChanged(); - VehicleMove(v, false); + VehicleUpdatePosition(v); CheckConsistencyOfArticulatedVehicle(v); } @@ -1127,7 +1127,8 @@ static bool IndividualRoadVehicleController(RoadVehicle *v, const RoadVehicle *p v->x_pos = gp.x; v->y_pos = gp.y; - VehicleMove(v, !(v->vehstatus & VS_HIDDEN)); + VehicleUpdatePosition(v); + if ((v->vehstatus & VS_HIDDEN) == 0) VehicleUpdateViewport(v, true); return true; } |