16
0
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:
docentYT
2026-04-28 13:23:14 +02:00
parent 6be1b0886d
commit ca839652bf
15 changed files with 64 additions and 59 deletions

View File

@@ -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;
}