17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 12:09:19 +02:00

refactor(sonar): make narrowing conversions explicit (cpp:S5276)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jerrrrycho
2026-10-10 15:16:28 +02:00
parent 80464d0bc1
commit 8c23c1fe2b
53 changed files with 468 additions and 468 deletions

View File

@@ -196,7 +196,7 @@ world_environment::update() {
if( true == (FreeFlyModeFlag || Global.CabWindowOpen)
&& Global.Weather == "rain:" ) {
if( m_rainsound.is_combined() ) {
m_rainsound.pitch( Global.Overcast - 1.0 );
m_rainsound.pitch( static_cast<float>(Global.Overcast - 1.0) );
}
m_rainsound
.gain( m_rainsound.m_amplitudeoffset + m_rainsound.m_amplitudefactor * 1.f )
@@ -228,12 +228,12 @@ world_environment::update_wind() {
m_wind.change_time -= timedelta;
if( m_wind.change_time < 0 ) {
m_wind.change_time = Random( 5, 15 );
m_wind.velocity_change = Random( -0.2, 0.2 );
m_wind.change_time = static_cast<float>(Random( 5, 15 ));
m_wind.velocity_change = static_cast<float>(Random( -0.2, 0.2 ));
if( Random() < 0.05 ) {
// changes in wind direction should be less frequent than changes in wind speed
// TBD, TODO: configuration-driven direction change frequency
m_wind.azimuth_change = Random( -5, 5 );
m_wind.azimuth_change = static_cast<float>(Random( -5, 5 ));
}
else {
// keep direction change periods short, to avoid too drastic changes in direction