(svn r23713) -Codechange: split VehicleMove() into two functions, to minimalize the work done where possible

This commit is contained in:
truebrain
2012-01-02 13:44:30 +00:00
parent 19004a77f8
commit 0d929e877f
11 changed files with 70 additions and 52 deletions

View File

@@ -314,8 +314,8 @@ CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, const Engine *
UpdateAircraftCache(v, true);
VehicleMove(v, false);
VehicleMove(u, false);
VehicleUpdatePosition(v);
VehicleUpdatePosition(u);
/* Aircraft with 3 vehicles (chopper)? */
if (v->subtype == AIR_HELICOPTER) {
@@ -336,7 +336,7 @@ CommandCost CmdBuildAircraft(TileIndex tile, DoCommandFlag flags, const Engine *
w->UpdateDeltaXY(INVALID_DIR);
u->SetNext(w);
VehicleMove(w, false);
VehicleUpdatePosition(w);
}
}
@@ -464,7 +464,7 @@ static void HelicopterTickHandler(Aircraft *v)
u->cur_image = img;
VehicleMove(u, true);
VehicleUpdatePositionAndViewport(u);
}
/**
@@ -494,7 +494,7 @@ void SetAircraftPosition(Aircraft *v, int x, int y, int z)
u->z_pos = GetSlopePixelZ(safe_x, safe_y);
u->cur_image = v->cur_image;
VehicleMove(u, true);
VehicleUpdatePositionAndViewport(u);
u = u->Next();
if (u != NULL) {
@@ -502,7 +502,7 @@ void SetAircraftPosition(Aircraft *v, int x, int y, int z)
u->y_pos = y;
u->z_pos = z + ROTOR_Z_OFFSET;
VehicleMove(u, true);
VehicleUpdatePositionAndViewport(u);
}
}