summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authortron <tron@openttd.org>2007-02-25 10:49:13 +0000
committertron <tron@openttd.org>2007-02-25 10:49:13 +0000
commit1ce43c1a3754499902a2749f9db3c426595ab02f (patch)
treef18ec0cd5e3a04d73bbbf9ddae8c4ee638ee9fc4 /src/vehicle.cpp
parent696b895b776ce8a990260d1a6829a93e675aa6c7 (diff)
downloadopenttd-1ce43c1a3754499902a2749f9db3c426595ab02f.tar.xz
(svn r8897) -Fix
Change the signature of GetNewVehiclePos(): -void GetNewVehiclePos(const Vehicle *v, GetNewVehiclePosResult *gp); +GetNewVehiclePosResult GetNewVehiclePos(const Vehicle *v);
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 9b05e3b0b..09e889dac 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -2692,7 +2692,7 @@ void EndVehicleMove(Vehicle *v)
}
/* returns true if staying in the same tile */
-void GetNewVehiclePos(const Vehicle *v, GetNewVehiclePosResult *gp)
+GetNewVehiclePosResult GetNewVehiclePos(const Vehicle *v)
{
static const int8 _delta_coord[16] = {
-1,-1,-1, 0, 1, 1, 1, 0, /* x */
@@ -2702,10 +2702,12 @@ void GetNewVehiclePos(const Vehicle *v, GetNewVehiclePosResult *gp)
int x = v->x_pos + _delta_coord[v->direction];
int y = v->y_pos + _delta_coord[v->direction + 8];
- gp->x = x;
- gp->y = y;
- gp->old_tile = v->tile;
- gp->new_tile = TileVirtXY(x, y);
+ GetNewVehiclePosResult gp;
+ gp.x = x;
+ gp.y = y;
+ gp.old_tile = v->tile;
+ gp.new_tile = TileVirtXY(x, y);
+ return gp;
}
static const Direction _new_direction_table[] = {