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

View File

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

View File

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

View File

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