(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

@@ -588,7 +588,8 @@ static void ShipController(Ship *v)
if (!IsTileType(gp.new_tile, MP_TUNNELBRIDGE) || !HasBit(VehicleEnterTile(v, gp.new_tile, gp.x, gp.y), VETS_ENTERED_WORMHOLE)) {
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;
}
}
@@ -680,7 +681,7 @@ CommandCost CmdBuildShip(TileIndex tile, DoCommandFlag flags, const Engine *e, u
v->InvalidateNewGRFCacheOfChain();
VehicleMove(v, false);
VehicleUpdatePosition(v);
}
return CommandCost();