mirror of https://github.com/OpenTTD/OpenTTD
(svn r10513) -Fix [FS#1022]: use vehicle subtile position to update cache, not tile, so that collision detection works on bridges and tunnels.
parent
2c517a3026
commit
1aaab031b2
|
@ -471,8 +471,8 @@ static void UpdateNewVehiclePosHash(Vehicle *v, bool remove)
|
||||||
if (remove) {
|
if (remove) {
|
||||||
new_hash = NULL;
|
new_hash = NULL;
|
||||||
} else {
|
} else {
|
||||||
int x = GB(TileX(v->tile), HASH_RES, HASH_BITS);
|
int x = GB(v->x_pos / TILE_SIZE, HASH_RES, HASH_BITS);
|
||||||
int y = GB(TileY(v->tile), HASH_RES, HASH_BITS) << 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];
|
new_hash = &_new_vehicle_position_hash[(x + y) & TOTAL_HASH_MASK];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue