1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 12:03:07 +01:00

Fix #4468: Boats at the Boat hire dock move on top of each other

Confusingly gSpriteSpatialIndex is indexed by .yx not .xy, all the more reason to use the dedicated helper method.
This commit is contained in:
Ted John
2016-09-24 12:55:17 +01:00
parent a170eeb367
commit fcb0f2acd6

View File

@@ -5747,7 +5747,7 @@ bool vehicle_update_bumper_car_collision(rct_vehicle *vehicle, sint16 x, sint16
location.x += Unk9A37C4[i].x;
location.y += Unk9A37C4[i].y;
uint16 spriteIdx = gSpriteSpatialIndex[location.xy];
uint16 spriteIdx = sprite_get_first_in_quadrant(location.x * 32, location.y * 32);
while (spriteIdx != 0xFFFF) {
rct_vehicle* vehicle2 = GET_VEHICLE(spriteIdx);
spriteIdx = vehicle2->next_in_quadrant;
@@ -7056,7 +7056,7 @@ static bool vehicle_update_motion_collision_detection(
location.x += Unk9A37C4[i].x;
location.y += Unk9A37C4[i].y;
collideId = gSpriteSpatialIndex[location.xy];
collideId = sprite_get_first_in_quadrant(location.x * 32, location.y * 32);
for(; collideId != 0xFFFF; collideId = collideVehicle->next_in_quadrant){
collideVehicle = GET_VEHICLE(collideId);
if (collideVehicle == vehicle) continue;