added difficulty level to level names for native BD levels
authorHolger Schemel <info@artsoft.org>
Sat, 9 Mar 2024 12:06:13 +0000 (13:06 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 9 Mar 2024 12:06:13 +0000 (13:06 +0100)
src/files.c

index 62069398a849b7b5aa877e95ead9b6a120ee4db1..4b2db0f89a9b80bf642e88db6133d1dd8f303b62 100644 (file)
@@ -3771,12 +3771,16 @@ static void CopyNativeLevel_BD_to_RND(struct LevelInfo *level)
   level->bd_intermission               = cave->intermission;
   level->bd_diagonal_movements         = cave->diagonal_movements;
 
-  strncpy(level->name, cave->name, MAX_LEVEL_NAME_LEN);
+  char *cave_name = getStringPrint("%s / %d", cave->name, bd_level_nr + 1);
+
+  strncpy(level->name, cave_name, MAX_LEVEL_NAME_LEN);
   level->name[MAX_LEVEL_NAME_LEN] = '\0';
 
   for (x = 0; x < level->fieldx; x++)
     for (y = 0; y < level->fieldy; y++)
       level->field[x][y] = map_element_BD_to_RND(cave->map[y][x]);
+
+  checked_free(cave_name);
 }
 
 static void setTapeInfoToDefaults(void);