Skip to content

Commit

Permalink
Wrongly built airports like the MS MKJS now keep their procedure info…
Browse files Browse the repository at this point in the history
…rmation in MSFS

despite trying to override it with an empty procedure set. albar965/littlenavmap#1085
  • Loading branch information
albar965 committed Feb 1, 2024
1 parent afc47c3 commit 75761f9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ This text is partially Markdown, hence sometimes strange formatting.
* Fixed wrong calculation for airport rating which did not update add-on airports.
* Deleting duplicate navaids now by region, ident and position now.
* Fixed issue where widget state could not find saved dialog state.
* Wrongly built airports like the MS MKJS now keep their procedure information in MSFS despite
trying to override it with an empty procedure set. #1085

===============================================================================

Expand Down
22 changes: 5 additions & 17 deletions src/fs/db/ap/deleteprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,6 @@ void DeleteProcessor::preProcessDelete()
// Get facility counts for current airport
extractPreviousAirportFeatures();

// Delete the whole tree of approaches, transitions and legs on the old airport later in
// ":/atools/resources/sql/fs/db/delete_duplicates.sql"

// if(prevHasApproach && isFlagSet(deleteFlags, bgl::del::APPROACHES))
// {
// SqlUtil sql(db);
// sql.bindAndExec("delete from transition where transition.approach_id in "
// "(select a.approach_id from approach a where a.airport_id = :prevApId)",
// ":prevApId", prevAirportId);
// sql.bindAndExec("delete from approach where airport_id = :prevApId",
// ":prevApId", prevAirportId);
// }

// ILS will be deleted later by deduplication
}

Expand Down Expand Up @@ -596,12 +583,13 @@ void DeleteProcessor::extractDeleteFlags()
// qDebug() << "processDelete Made up flags" << deleteFlags;
}

// Do not delete anything if the new airport has no corresponding features
// Also do this as a workaround for MSFS airports like MKJS_Scene.bgl
if(curAirport->getApproaches().isEmpty())
deleteFlags &= ~bgl::del::APPROACHES;

if(options.getSimulatorType() != atools::fs::FsPaths::MSFS)
{
// Do not delete anything if the new airport has no corresponding features
if(curAirport->getApproaches().isEmpty())
deleteFlags &= ~bgl::del::APPROACHES;

// if(newAirport->getAprons().isEmpty())
// deleteFlags &= ~bgl::del::APRONS;

Expand Down
2 changes: 1 addition & 1 deletion src/fs/db/ap/deleteprocessor.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*****************************************************************************
* Copyright 2015-2023 Alexander Barthel [email protected]
* Copyright 2015-2024 Alexander Barthel [email protected]
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down

0 comments on commit 75761f9

Please sign in to comment.