maps:allow zgm extension, use zgm by default in editor

This commit is contained in:
andy5995
2018-09-27 02:45:04 -05:00
parent 5a041e4e36
commit 62e3819d86
6 changed files with 42 additions and 21 deletions

View File

@@ -1111,12 +1111,17 @@ namespace Shared {
endPathWithSlash(map_path);
const string original = map_path + mapName;
const string zeta = map_path + mapName + ".zgm";
const string mega = map_path + mapName + ".mgm";
const string glest = map_path + mapName + ".gbm";
if ((EndsWith(original, ".mgm") == true || EndsWith(original, ".gbm") == true) &&
fileExists(original)) {
if (( EndsWith(original, ".zgm") == true ||
EndsWith(original, ".mgm") == true ||
EndsWith(original, ".gbm") == true) &&
fileExists(original)) {
return original;
} else if (fileExists(zeta)) {
return zeta;
} else if (fileExists(mega)) {
return mega;
} else if (fileExists(glest)) {
@@ -1146,6 +1151,10 @@ namespace Shared {
findAll(path + "*.gbm", results2, cutExtension, false);
copy(results2.begin(), results2.end(), std::inserter(allMaps2, allMaps2.begin()));
results2.clear();
findAll(path + "*.zgm", results2, cutExtension, false);
copy(results2.begin(), results2.end(), std::inserter(allMaps2, allMaps2.begin()));
results2.clear();
findAll(path + "*.mgm", results2, cutExtension, false);
copy(results2.begin(), results2.end(), std::inserter(allMaps2, allMaps2.begin()));
@@ -1160,6 +1169,10 @@ namespace Shared {
findAll(pathList, "*.gbm", results, cutExtension, false);
copy(results.begin(), results.end(), std::inserter(allMaps, allMaps.begin()));
results.clear();
findAll(pathList, "*.zgm", results, cutExtension, false);
copy(results.begin(), results.end(), std::inserter(allMaps, allMaps.begin()));
results.clear();
findAll(pathList, "*.mgm", results, cutExtension, false);
copy(results.begin(), results.end(), std::inserter(allMaps, allMaps.begin()));