fixed warning for missing level template when loading level
authorHolger Schemel <info@artsoft.org>
Fri, 17 Aug 2018 13:11:19 +0000 (15:11 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 17 Aug 2018 13:11:27 +0000 (15:11 +0200)
src/files.c

index 151c8079966f31384daa580d6a82119bb04267b6..37864e0d6a274679d0c6710bfa34c7f922fd9303 100644 (file)
@@ -6582,6 +6582,13 @@ void LoadLevelTemplate(int nr)
 {
   char *filename;
 
+  if (!fileExists(getGlobalLevelTemplateFilename()))
+  {
+    Error(ERR_WARN, "no level template found for this level");
+
+    return;
+  }
+
   setLevelFileInfo(&level_template.file_info, nr);
   filename = level_template.file_info.filename;