diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 2d67e32013..c313b6cf8b 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -45,8 +45,6 @@ #include #include -static void vehicle_claxon(const Vehicle* vehicle); - static bool vehicle_boat_is_location_accessible(const CoordsXYZ& location); static bool vehicle_update_motion_collision_detection( Vehicle* vehicle, int16_t x, int16_t y, int16_t z, uint16_t* otherVehicleIndex); @@ -9869,7 +9867,7 @@ void Vehicle::UpdateCrossings() const { if (!playedClaxon && !pathElement->IsBlockedByVehicle()) { - vehicle_claxon(this); + Claxon(); } crossingBonus = 4; pathElement->SetIsBlockedByVehicle(true); @@ -9942,16 +9940,16 @@ void Vehicle::UpdateCrossings() const } } -void vehicle_claxon(const Vehicle* vehicle) +void Vehicle::Claxon() const { - rct_ride_entry* rideEntry = get_ride_entry(vehicle->ride_subtype); - switch (rideEntry->vehicles[vehicle->vehicle_type].sound_range) + rct_ride_entry* rideEntry = get_ride_entry(ride_subtype); + switch (rideEntry->vehicles[vehicle_type].sound_range) { case SOUND_RANGE_WHISTLE: - audio_play_sound_at_location(SoundId::TrainWhistle, { vehicle->x, vehicle->y, vehicle->z }); + audio_play_sound_at_location(SoundId::TrainWhistle, { x, y, z }); break; case SOUND_RANGE_BELL: - audio_play_sound_at_location(SoundId::Tram, { vehicle->x, vehicle->y, vehicle->z }); + audio_play_sound_at_location(SoundId::Tram, { x, y, z }); break; } } diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index fc7d1069ba..eef016ae39 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -378,6 +378,7 @@ private: void ReverseReverserCar(); void UpdateReverserCarBogies(); void UpdateHandleWaterSplash() const; + void Claxon() const; }; struct train_ref