summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/vehicle.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index d331f6325..b2d1ccdac 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -471,8 +471,8 @@ static void UpdateNewVehiclePosHash(Vehicle *v, bool remove)
if (remove) {
new_hash = NULL;
} else {
- int x = GB(TileX(v->tile), HASH_RES, HASH_BITS);
- int y = GB(TileY(v->tile), HASH_RES, HASH_BITS) << HASH_BITS;
+ int x = GB(v->x_pos / TILE_SIZE, HASH_RES, HASH_BITS);
+ int y = GB(v->y_pos / TILE_SIZE, HASH_RES, HASH_BITS) << HASH_BITS;
new_hash = &_new_vehicle_position_hash[(x + y) & TOTAL_HASH_MASK];
}