mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-27 00:34:46 +01:00
Fix wrong vehicle position, nullptr guard
This commit is contained in:
@@ -346,8 +346,8 @@ void vehicle_update_sound_params(rct_vehicle* vehicle)
|
||||
i->id = vehicle->sprite_index;
|
||||
i->volume = 0;
|
||||
if (vehicle->x != (sint16)0x8000) {
|
||||
rct_map_element* map_element = map_get_surface_element_at(vehicle->x, vehicle->y);
|
||||
if (map_element->base_height * 8 > vehicle->z) { // vehicle underground
|
||||
rct_map_element* map_element = map_get_surface_element_at(vehicle->x >> 5, vehicle->y >> 5);
|
||||
if (map_element != NULL && map_element->base_height * 8 > vehicle->z) { // vehicle underground
|
||||
i->volume = 0x30;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user