From 54ec06258aaae0b55a186d914211ce7cfb2513e6 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sun, 19 Mar 2017 21:59:24 +0000 Subject: [PATCH] (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) --- src/ship_cmd.cpp | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 5f6a77f370..2235cc4b29 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);