added support for Mirror Magic levels if filetype is explicitly specified
authorHolger Schemel <info@artsoft.org>
Fri, 17 Feb 2017 22:09:09 +0000 (23:09 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Mar 2018 22:21:07 +0000 (23:21 +0100)
src/files.c

index ebb61203b4793a13dfc02be87f13d176fe036af3..4cc8065647a2c5daf566b48f5010b6051931f22a 100644 (file)
@@ -1319,6 +1319,8 @@ filetype_id_list[] =
   { LEVEL_FILE_TYPE_DX,                "DX"    },
   { LEVEL_FILE_TYPE_SB,                "SB"    },
   { LEVEL_FILE_TYPE_DC,                "DC"    },
+  { LEVEL_FILE_TYPE_MM,                "MM"    },
+  { LEVEL_FILE_TYPE_MM,                "DF"    },
   { -1,                                NULL    },
 };
 
@@ -2120,6 +2122,16 @@ static void determineLevelFileInfo_Filename(struct LevelFileInfo *lfi)
     if (fileExists(lfi->filename))
       return;
   }
+  else if (leveldir_current->level_filetype != NULL)
+  {
+    int filetype = getFiletypeFromID(leveldir_current->level_filetype);
+
+    /* check for specified native level file with standard file name */
+    setLevelFileInfo_FormatLevelFilename(lfi, filetype,
+                                        "%03d.%s", nr, LEVELFILE_EXTENSION);
+    if (fileExists(lfi->filename))
+      return;
+  }
 
   /* check for native Rocks'n'Diamonds level file */
   setLevelFileInfo_FormatLevelFilename(lfi, LEVEL_FILE_TYPE_RND,