summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2017-03-19 21:59:24 +0000
committerpeter1138 <peter1138@openttd.org>2017-03-19 21:59:24 +0000
commit2a555480bd7acdd7e8a1202ce4be983dedf9b7b3 (patch)
tree70b601285148a567a2b29bf0b3fda4269f0fbc55 /src
parent4f9fd074b8588d8ced7d04a99c6db6be2cacd1e0 (diff)
downloadopenttd-2a555480bd7acdd7e8a1202ce4be983dedf9b7b3.tar.xz
(svn r27806) -Codechange: Remove function ShipGetNewDirection
ShipGetNewDirection has no side effects and its return value is ignored by its only caller, so do away with it. Also remove now unused _new_vehicle_direction_table. (cirdan)
Diffstat (limited to 'src')
-rw-r--r--src/ship_cmd.cpp14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp
index 5f6a77f37..2235cc4b2 100644
--- a/src/ship_cmd.cpp
+++ b/src/ship_cmd.cpp
@@ -456,19 +456,6 @@ static Track ChooseShipTrack(Ship *v, TileIndex tile, DiagDirection enterdir, Tr
return track;
}
-static const Direction _new_vehicle_direction_table[] = {
- DIR_N , DIR_NW, DIR_W , INVALID_DIR,
- DIR_NE, DIR_N , DIR_SW, INVALID_DIR,
- DIR_E , DIR_SE, DIR_S
-};
-
-static Direction ShipGetNewDirection(Vehicle *v, int x, int y)
-{
- uint offs = (y - v->y_pos + 1) * 4 + (x - v->x_pos + 1);
- assert(offs < 11 && offs != 3 && offs != 7);
- return _new_vehicle_direction_table[offs];
-}
-
static inline TrackBits GetAvailShipTracks(TileIndex tile, DiagDirection dir)
{
return GetTileShipTrackStatus(tile) & DiagdirReachesTracks(dir);
@@ -633,7 +620,6 @@ static void ShipController(Ship *v)
}
/* update image of ship, as well as delta XY */
- dir = ShipGetNewDirection(v, gp.x, gp.y);
v->x_pos = gp.x;
v->y_pos = gp.y;
v->z_pos = GetSlopePixelZ(gp.x, gp.y);