(svn r23713) -Codechange: split VehicleMove() into two functions, to minimalize the work done where possible
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user