mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-19 04:53:12 +01:00
* Refactor Vehicle Scream Sound goto * updated contributors
This commit is contained in:
@@ -5560,10 +5560,6 @@ void Vehicle::UpdateSound()
|
||||
*/
|
||||
SoundId Vehicle::UpdateScreamSound()
|
||||
{
|
||||
rct_ride_entry* rideEntry = GetRideEntry();
|
||||
|
||||
rct_ride_entry_vehicle* vehicleEntry = &rideEntry->vehicles[vehicle_type];
|
||||
|
||||
int32_t totalNumPeeps = NumPeepsUntilTrainTail();
|
||||
if (totalNumPeeps == 0)
|
||||
return SoundId::Null;
|
||||
@@ -5585,11 +5581,11 @@ SoundId Vehicle::UpdateScreamSound()
|
||||
if (vehicle2->vehicle_sprite_type < 1)
|
||||
continue;
|
||||
if (vehicle2->vehicle_sprite_type <= 4)
|
||||
goto produceScream;
|
||||
return ProduceScreamSound(totalNumPeeps);
|
||||
if (vehicle2->vehicle_sprite_type < 9)
|
||||
continue;
|
||||
if (vehicle2->vehicle_sprite_type <= 15)
|
||||
goto produceScream;
|
||||
return ProduceScreamSound(totalNumPeeps);
|
||||
}
|
||||
return SoundId::Null;
|
||||
}
|
||||
@@ -5608,15 +5604,21 @@ SoundId Vehicle::UpdateScreamSound()
|
||||
if (vehicle2->vehicle_sprite_type < 5)
|
||||
continue;
|
||||
if (vehicle2->vehicle_sprite_type <= 8)
|
||||
goto produceScream;
|
||||
return ProduceScreamSound(totalNumPeeps);
|
||||
if (vehicle2->vehicle_sprite_type < 17)
|
||||
continue;
|
||||
if (vehicle2->vehicle_sprite_type <= 23)
|
||||
goto produceScream;
|
||||
return ProduceScreamSound(totalNumPeeps);
|
||||
}
|
||||
return SoundId::Null;
|
||||
}
|
||||
|
||||
SoundId Vehicle::ProduceScreamSound(const int32_t totalNumPeeps)
|
||||
{
|
||||
rct_ride_entry* rideEntry = GetRideEntry();
|
||||
|
||||
rct_ride_entry_vehicle* vehicleEntry = &rideEntry->vehicles[vehicle_type];
|
||||
|
||||
produceScream:
|
||||
if (scream_sound_id == SoundId::Null)
|
||||
{
|
||||
auto r = scenario_rand();
|
||||
|
||||
@@ -401,6 +401,7 @@ private:
|
||||
void UpdateCrossings() const;
|
||||
void UpdateSound();
|
||||
SoundId UpdateScreamSound();
|
||||
SoundId ProduceScreamSound(const int32_t totalNumPeeps);
|
||||
void UpdateCrashSetup();
|
||||
void UpdateCollisionSetup();
|
||||
int32_t UpdateMotionDodgems();
|
||||
|
||||
Reference in New Issue
Block a user