mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 00:49:19 +02:00
Use the sq function to force constexpr expressions for numeric literals and enhance readability
This commit is contained in:
@@ -9724,7 +9724,7 @@ TTrain::radio_message( sound_source *Message, int const Channel ) {
|
||||
|
||||
auto const soundrange { Message->range() };
|
||||
if( ( soundrange > 0 )
|
||||
&& ( glm::length2( Message->location() - glm::dvec3 { DynamicObject->GetPosition() } ) > ( soundrange * soundrange ) ) ) {
|
||||
&& ( glm::length2( Message->location() - glm::dvec3 { DynamicObject->GetPosition() } ) > sq(soundrange) ) ) {
|
||||
// skip message playback if the receiver is outside of the emitter's range
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user