Changeset - r7232:d1887dca9a19
[Not reviewed]
master
0 1 0
peter1138 - 17 years ago 2007-07-11 21:31:34
peter1138@openttd.org
(svn r10513) -Fix [FS#1022]: use vehicle subtile position to update cache, not tile, so that collision detection works on bridges and tunnels.
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/vehicle.cpp
Show inline comments
 
@@ -471,8 +471,8 @@ static void UpdateNewVehiclePosHash(Vehi
 
	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];
 
	}
 

	
0 comments (0 inline, 0 general)