mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-31 04:12:20 +01:00
refactor(sonar): scope single-use variables in if init-statements (cpp:S6004)
This commit is contained in:
@@ -172,11 +172,7 @@ void TCamera::Update()
|
||||
// attached movement position update
|
||||
auto movement { Velocity * -2.0 };
|
||||
movement.y = -movement.y;
|
||||
auto const *owner { (
|
||||
m_owner->Mechanik ?
|
||||
m_owner->Mechanik :
|
||||
m_owner->ctOwner ) };
|
||||
if( owner && owner->Occupied()
|
||||
if( auto const *owner { ( m_owner->Mechanik ? m_owner->Mechanik : m_owner->ctOwner ) }; owner && owner->Occupied()
|
||||
&& owner->Occupied()->CabOccupied < 0 ) {
|
||||
movement *= -1.f;
|
||||
movement.y = -movement.y;
|
||||
|
||||
Reference in New Issue
Block a user