diff --git a/Source/Core/Map/BSP.cs b/Source/Core/Map/BSP.cs
index 5539142..31efa29 100644
--- a/Source/Core/Map/BSP.cs
+++ b/Source/Core/Map/BSP.cs
@@ -46,7 +46,7 @@ namespace CodeImp.DoomBuilder.Map
this.deactivate = deactivate;
if (!deactivate)
{
- if (General.Map.IsChanged) BuildNodes();
+ if (General.Map.IsChanged && !General.Map.RebuildNodes(General.Map.ConfigSettings.NodebuilderSave, true)) return;
LoadStructures();
}
@@ -76,25 +76,11 @@ namespace CodeImp.DoomBuilder.Map
{
if (!deactivate && General.Map.IsChanged)
{
- BuildNodes();
+ if (!General.Map.RebuildNodes(General.Map.ConfigSettings.NodebuilderSave, true)) return;
LoadStructures();
}
}
- ///
- /// This (re)builds the nodes for the whole map.
- ///
- private void BuildNodes()
- {
- // There is no API available to do this directly, but we export the map which will
- // cause the DB core to build the nodes (with testing parameters)
- General.Interface.DisplayStatus(StatusType.Busy, "Building map nodes...");
- string tempfile = General.MakeTempFilename(General.Map.TempPath, "wad");
- General.Map.IsChanged = true;
- General.Map.ExportToFile(tempfile);
- File.Delete(tempfile);
- }
-
///
/// This loads all nodes structures data from the lumps
///