summaryrefslogtreecommitdiff
path: root/vehicle.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-08 06:55:33 +0000
committertron <tron@openttd.org>2006-03-08 06:55:33 +0000
commitfbe939b31f8c7ea4e6e47d6d903625dd25c5e856 (patch)
tree5dc0e72ac096a8404e81f92e3e1480cb29c96061 /vehicle.c
parent313754011d04ad4913bf4028b78d75ceb359e9b3 (diff)
downloadopenttd-fbe939b31f8c7ea4e6e47d6d903625dd25c5e856.tar.xz
(svn r3783) Replace further ints and magic numbers by Direction, DiagDirection and friends
Diffstat (limited to 'vehicle.c')
-rw-r--r--vehicle.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/vehicle.c b/vehicle.c
index a368c5d4b..e4dd53774 100644
--- a/vehicle.c
+++ b/vehicle.c
@@ -1921,15 +1921,16 @@ bool GetNewVehiclePos(const Vehicle *v, GetNewVehiclePosResult *gp)
return gp->old_tile == gp->new_tile;
}
-static const byte _new_direction_table[9] = {
- 0, 7, 6,
- 1, 3, 5,
- 2, 3, 4,
+static const Direction _new_direction_table[] = {
+ DIR_N , DIR_NW, DIR_W ,
+ DIR_NE, DIR_SE, DIR_SW,
+ DIR_E , DIR_SE, DIR_S
};
-byte GetDirectionTowards(const Vehicle *v, int x, int y)
+Direction GetDirectionTowards(const Vehicle* v, int x, int y)
{
- byte dirdiff, dir;
+ Direction dir;
+ byte dirdiff;
int i = 0;
if (y >= v->y_pos) {