From 30406a76655096275a7d3f7bb313773cea61ceaa Mon Sep 17 00:00:00 2001 From: Tubix Date: Sat, 4 Jan 2025 20:32:23 +0000 Subject: [PATCH] load map xml without version --- src/alternativa/editor/mapimport/TanksXmlImporter.as | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/alternativa/editor/mapimport/TanksXmlImporter.as b/src/alternativa/editor/mapimport/TanksXmlImporter.as index f80d7eb..24d682a 100644 --- a/src/alternativa/editor/mapimport/TanksXmlImporter.as +++ b/src/alternativa/editor/mapimport/TanksXmlImporter.as @@ -2,7 +2,6 @@ package alternativa.editor.mapimport { import alternativa.editor.LibraryManager; import alternativa.editor.events.EditorProgressEvent; - import alternativa.editor.mapimport.xml.IXMLImporter; import alternativa.editor.mapimport.xml.XMLImporterV1; import alternativa.editor.mapimport.xml.XMLImporterV1Full; import alternativa.editor.mapimport.xml.XMLImporterV2; @@ -11,9 +10,12 @@ package alternativa.editor.mapimport import flash.events.Event; import flash.filesystem.FileStream; import mx.controls.Alert; + import alternativa.editor.mapimport.xml.IXMLImporter; public class TanksXmlImporter extends FileImporter { + private static const DEFAULT_IMPORTER:String = "1.0"; + private var importers:Object; public function TanksXmlImporter(param1:MainScene, param2:LibraryManager) @@ -34,8 +36,8 @@ package alternativa.editor.mapimport var loc4:IXMLImporter = this.importers[loc3]; if(loc4 == null) { - Alert.show("Unsupported version " + loc3); - return; + loc4 = this.importers[DEFAULT_IMPORTER]; + Alert.show("Unsupported importer version " + loc3 + "! 1.0 is used as a default"); } loc4.importMap(loc2,scene,libraryManager); } @@ -48,8 +50,8 @@ package alternativa.editor.mapimport var loc4:IXMLImporter = this.importers[loc3]; if(loc4 == null) { - Alert.show("Unsupported version " + loc3); - return; + loc4 = this.importers[DEFAULT_IMPORTER]; + Alert.show("Unsupported importer version " + loc3 + "! 1.0 is used as a default"); } loc4.addInternalObjectsToExistingScene(loc2,scene,libraryManager); }