Update editor scripts to Gridarta r5480.

git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@10072 282e977c-c81d-0410-88c4-b93c2d0d6712
master
akirschbaum 2008-10-11 21:10:27 +00:00
parent 548577faef
commit 97ecd9cad0
4 changed files with 491 additions and 483 deletions

View File

@ -278,6 +278,7 @@ void convertMap(File mapFile, String mapPath) {
return; return;
} }
try {
mapControl.getMapModel().beginTransaction("spell conversion"); mapControl.getMapModel().beginTransaction("spell conversion");
try { try {
Iterator it1 = mapControl.getAllSquares().iterator(); Iterator it1 = mapControl.getAllSquares().iterator();
@ -297,6 +298,9 @@ void convertMap(File mapFile, String mapPath) {
countMapFiles++; countMapFiles++;
mapControl.save(); mapControl.save();
} }
} finally {
mapManager.release(mapControl);
}
} }
if (baseDirectory == null || baseDirectory.length() <= 0) { if (baseDirectory == null || baseDirectory.length() <= 0) {

View File

@ -16,6 +16,7 @@ void normalizeMap(File mapFile, String mapPath) {
return; return;
} }
try {
if (!mapPath.startsWith("/styles") if (!mapPath.startsWith("/styles")
&& !mapPath.startsWith("/editor")) { && !mapPath.startsWith("/editor")) {
mapModel = map.getMapModel(); mapModel = map.getMapModel();
@ -31,6 +32,9 @@ void normalizeMap(File mapFile, String mapPath) {
} }
map.save(); map.save();
} finally {
mapManager.release(map);
}
} }
if (baseDirectory == null || baseDirectory.length() <= 0) { if (baseDirectory == null || baseDirectory.length() <= 0) {

View File

@ -25,14 +25,16 @@ void checkMap(File mapFile, String mapPath) {
log("- cannot load map file"); log("- cannot load map file");
return; return;
} }
ErrorCollector errorCollector; ErrorCollector errorCollector;
try {
try { try {
validators.validateAll(map.getMapModel()); validators.validateAll(map.getMapModel());
} finally { } finally {
errorCollector = map.getMapModel().getErrors(); errorCollector = map.getMapModel().getErrors();
if (map.nViews() <= 0) {
mapManager.closeLevel(map);
} }
} finally {
mapManager.release(map);
} }
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();

View File

@ -47,9 +47,7 @@ boolean updateMap(File mapFile, File pictureFile) {
return false; return false;
} }
} finally { } finally {
if (map.nViews() <= 0) { mapManager.release(map);
mapManager.closeLevel(map);
}
} }
return true; return true;
} }