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/ship_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/ship_cmd.cpp')
-rw-r--r-- | src/ship_cmd.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 00bc770d8..2a65dfcf4 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -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(); |