Skip to content

Commit

Permalink
Fix Carryall direction on landing
Browse files Browse the repository at this point in the history
  • Loading branch information
chaserli committed Mar 13, 2024
1 parent eef9bc0 commit fc877c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Ext/Aircraft/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,9 @@ DirType AircraftExt::GetLandingDir(AircraftClass* pThis, BuildingClass* pDock)
if (pDock || pThis->HasAnyLink())
{
auto pBuilding = pDock;

Check warning on line 73 in src/Ext/Aircraft/Body.cpp

View workflow job for this annotation

GitHub Actions / build

'pBuilding': local variable is initialized but not referenced [D:\a\Phobos\Phobos\Phobos.vcxproj]

Check warning on line 73 in src/Ext/Aircraft/Body.cpp

View workflow job for this annotation

GitHub Actions / build

auto pBuilding = pDock; [D:\a\Phobos\Phobos\Phobos.vcxproj]

Check warning on line 73 in src/Ext/Aircraft/Body.cpp

View workflow job for this annotation

GitHub Actions / build

^ [D:\a\Phobos\Phobos\Phobos.vcxproj]
auto pLink = pThis->GetNthLink(0);

if (!pDock)
pBuilding = abstract_cast<BuildingClass*>(pThis->GetNthLink(0));

if (pBuilding)
if (auto pBuilding = pDock ? pDock : abstract_cast<BuildingClass*>(pLink))

Check warning on line 76 in src/Ext/Aircraft/Body.cpp

View workflow job for this annotation

GitHub Actions / build

declaration of 'pBuilding' hides previous local declaration [D:\a\Phobos\Phobos\Phobos.vcxproj]

Check warning on line 76 in src/Ext/Aircraft/Body.cpp

View workflow job for this annotation

GitHub Actions / build

if (auto pBuilding = pDock ? pDock : abstract_cast<BuildingClass*>(pLink)) [D:\a\Phobos\Phobos\Phobos.vcxproj]

Check warning on line 76 in src/Ext/Aircraft/Body.cpp

View workflow job for this annotation

GitHub Actions / build

^ [D:\a\Phobos\Phobos\Phobos.vcxproj]
{
auto const pBuildingTypeExt = BuildingTypeExt::ExtMap.Find(pBuilding->Type);
int docks = pBuilding->Type->NumberOfDocks;
Expand All @@ -89,6 +87,8 @@ DirType AircraftExt::GetLandingDir(AircraftClass* pThis, BuildingClass* pDock)
else if (docks > 0 && !pBuildingTypeExt->AircraftDockingDirs[0].empty())
return pBuildingTypeExt->AircraftDockingDirs[0].get();
}
else if (!pThis->Type->AirportBound)
return pLink->PrimaryFacing.Current().GetDir();
}
else if (!pThis->Type->AirportBound)
{
Expand Down

0 comments on commit fc877c9

Please sign in to comment.