From ab7e7ec7b4240f4a81c338e2d62d48690d6e34b2 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Wed, 11 Mar 2020 00:07:56 +0000 Subject: [PATCH] src/Main/globals.cxx: don't load /ai/models/ from autosave.xml file. This cleans things up if earlier 'next' build as added spurious property items to autosave. --- src/Main/globals.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index 9aeb37ac7..bb9b5d9f4 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -808,6 +808,14 @@ FGGlobals::loadUserSettings(SGPath userDataPath) } else { tryAutosaveMigration(userDataPath, &autosave); } + /* Before 2020-03-10, we could save portions of the /ai/models/ tree, which + confuses things when loaded again. So delete any such items if they have + been loaded. */ + SGPropertyNode* ai = autosave.getNode("ai"); + if (ai) { + SGPropertyNode* ai_models = ai->getNode("models"); + ai->removeChildren("models"); + } copyProperties(&autosave, globals->get_props()); }