@@ -75,11 +75,49 @@ function dumpNodes ( xmlNode, elementTable, elementChildren )
75
75
end
76
76
end
77
77
78
+ local function syncMapMinVersion (mapXml )
79
+ local metaFile = xmlLoadFile (" meta.xml" )
80
+
81
+ if not metaFile then
82
+ return false
83
+ end
84
+
85
+ local editorMinVer = xmlFindChild (metaFile , " min_mta_version" , 0 )
86
+
87
+ if editorMinVer then
88
+ local mapVersionNode = xmlFindChild (mapXml , " min_mta_version" , 0 ) or xmlCreateChild (mapXml , " min_mta_version" )
89
+
90
+ if mapVersionNode then
91
+ local clientMinVer = xmlNodeGetAttribute (editorMinVer , " client" )
92
+ local serverMinVer = xmlNodeGetAttribute (editorMinVer , " server" )
93
+
94
+ if clientMinVer then
95
+ xmlNodeSetAttribute (mapVersionNode , " client" , clientMinVer )
96
+ end
97
+
98
+ if serverMinVer then
99
+ xmlNodeSetAttribute (mapVersionNode , " server" , serverMinVer )
100
+ end
101
+ end
102
+ end
103
+
104
+ xmlUnloadFile (metaFile )
105
+
106
+ return true
107
+ end
108
+
78
109
function dumpMeta ( xml , extraNodes , resource , filename , test )
79
- if not resource then return false end
110
+ if not resource then
111
+ return false
112
+ end
113
+
80
114
dimension = dimension or 0
81
115
extraNodes = extraNodes or {}
82
116
117
+ -- Fetch min_mta_version from editor_main meta.xml
118
+
119
+ syncMapMinVersion (xml )
120
+
83
121
-- Add OOP support
84
122
--[[ local oopNode = xmlCreateChild(xml, "oop")
85
123
xmlNodeSetValue(oopNode, "true")]]
0 commit comments