From dba2ec30bb9c205ecf550582a4b37725fcb10f49 Mon Sep 17 00:00:00 2001 From: Starkku Date: Sun, 17 Mar 2024 21:32:12 +0200 Subject: [PATCH] Fix LandingDir for non-AirportBound aircraft --- src/Ext/Aircraft/Body.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Ext/Aircraft/Body.cpp b/src/Ext/Aircraft/Body.cpp index faa33ed39a..f1672abc78 100644 --- a/src/Ext/Aircraft/Body.cpp +++ b/src/Ext/Aircraft/Body.cpp @@ -66,8 +66,6 @@ DirType AircraftExt::GetLandingDir(AircraftClass* pThis, BuildingClass* pDock) if (auto pOwner = pThis->SpawnOwner) return pOwner->PrimaryFacing.Current().GetDir(); - bool isAirportBound = true; - if (pDock || pThis->HasAnyLink()) { auto pLink = pThis->GetNthLink(0); @@ -89,18 +87,12 @@ DirType AircraftExt::GetLandingDir(AircraftClass* pThis, BuildingClass* pDock) else if (!pThis->Type->AirportBound) return pLink->PrimaryFacing.Current().GetDir(); } - else if (!pThis->Type->AirportBound) - { - isAirportBound = false; - } int landingDir = TechnoTypeExt::ExtMap.Find(pThis->GetTechnoType())->LandingDir.Get((int)poseDir); - if (isAirportBound) - return static_cast(Math::clamp(landingDir, 0, 255)); - else if (landingDir < 0) + if (!pThis->Type->AirportBound && landingDir < 0) return pThis->PrimaryFacing.Current().GetDir(); - return poseDir; + return static_cast(Math::clamp(landingDir, 0, 255)); }