Made invalid legacy maps be properly discarded

This commit is contained in:
Anuken
2019-05-16 17:15:22 -04:00
parent aeb3662414
commit 8616fc6b05
2 changed files with 6 additions and 2 deletions

View File

@@ -162,12 +162,12 @@ public class Maps implements Disposable{
for(FileHandle file : customMapDirectory.list()){
if(file.extension().equalsIgnoreCase(oldMapExtension)){
try{
convertedAny = true;
LegacyMapIO.convertMap(file, file.sibling(file.nameWithoutExtension() + "." + mapExtension));
//delete old, converted file; it is no longer useful
file.delete();
convertedAny = true;
Log.info("Converted file {0}", file);
}catch(IOException e){
}catch(Exception e){
//rename the file to a 'mmap_conversion_failed' extension to keep it there just in case
//but don't delete it
file.copyTo(file.sibling(file.name() + "_conversion_failed"));