From 21372e6a57bdb90296b0aec73361badafcb1de70 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 16 Mar 2024 12:49:11 +0100 Subject: [PATCH] added storing current level set identifier in caveset structure --- src/game_bd/bd_caveset.c | 6 +++++- src/game_bd/bd_caveset.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/game_bd/bd_caveset.c b/src/game_bd/bd_caveset.c index e7f292b6..deb46a24 100644 --- a/src/game_bd/bd_caveset.c +++ b/src/game_bd/bd_caveset.c @@ -87,6 +87,8 @@ GdCavesetData *gd_caveset_data_new(void) gd_struct_set_defaults_from_array(data, gd_caveset_properties, caveset_defaults); + data->levelset_subdir = getStringCopy(leveldir_current->subdir); + return data; } @@ -99,7 +101,9 @@ void gd_caveset_data_free(GdCavesetData *data) if (gd_caveset_properties[i].type == GD_TYPE_LONGSTRING) checked_free(STRUCT_MEMBER(char *, data, gd_caveset_properties[i].offset)); - free(data); + checked_free(data->levelset_subdir); + + checked_free(data); } // ============================================================================ diff --git a/src/game_bd/bd_caveset.h b/src/game_bd/bd_caveset.h index 368d7ff5..7cd23f66 100644 --- a/src/game_bd/bd_caveset.h +++ b/src/game_bd/bd_caveset.h @@ -45,6 +45,8 @@ typedef struct _gd_caveset_data // and this one the highscores GdHighScore highscore[GD_HIGHSCORE_NUM]; + + char *levelset_subdir; // current level set identifier } GdCavesetData; extern const GdStructDescriptor gd_caveset_properties[]; -- 2.34.1