From: Holger Schemel Date: Sun, 13 Mar 2022 10:21:23 +0000 (+0100) Subject: reverted commit 4ca952cbcd991a3e351b6292b37e47361b8f04d3 X-Git-Tag: 4.3.2.0~77 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=6e998e708ed7258d98fafed008aee9c915e7b3fa;p=rocksndiamonds.git reverted commit 4ca952cbcd991a3e351b6292b37e47361b8f04d3 It turned out that the removed code did not only check for configured artwork set in file "levelinfo.conf", but also for existing artwork sub-directories in the previous and current level set when changing level sets, causing such artwork to be ignored instead of activated. This has to be handled differently to still work in such cases. --- diff --git a/src/init.c b/src/init.c index 92ba9215..eaee671d 100644 --- a/src/init.c +++ b/src/init.c @@ -6026,8 +6026,10 @@ static void InitOverrideArtwork(void) static char *getNewArtworkIdentifier(int type) { + static char *last_leveldir_identifier[3] = { NULL, NULL, NULL }; static char *last_artwork_identifier[3] = { NULL, NULL, NULL }; static boolean last_override_level_artwork[3] = { FALSE, FALSE, FALSE }; + static boolean last_has_level_artwork_set[3] = { FALSE, FALSE, FALSE }; static boolean initialized[3] = { FALSE, FALSE, FALSE }; TreeInfo *artwork_first_node = ARTWORK_FIRST_NODE(artwork, type); boolean setup_override_artwork = GFX_OVERRIDE_ARTWORK(type); @@ -6035,6 +6037,7 @@ static char *getNewArtworkIdentifier(int type) char *leveldir_identifier = leveldir_current->identifier; // !!! setLevelArtworkDir() should be moved to an earlier stage !!! char *leveldir_artwork_set = setLevelArtworkDir(artwork_first_node); + boolean has_level_artwork_set = (leveldir_artwork_set != NULL); char *artwork_current_identifier; char *artwork_new_identifier = NULL; // default: nothing has changed @@ -6062,6 +6065,14 @@ static char *getNewArtworkIdentifier(int type) /* 2nd step: check if it is really needed to reload artwork set ------------------------------------------------------------ */ + // ---------- reload if level set and also artwork set has changed ---------- + if (last_leveldir_identifier[type] != leveldir_identifier && + (last_has_level_artwork_set[type] || has_level_artwork_set)) + artwork_new_identifier = artwork_current_identifier; + + last_leveldir_identifier[type] = leveldir_identifier; + last_has_level_artwork_set[type] = has_level_artwork_set; + // ---------- reload if "override artwork" setting has changed -------------- if (last_override_level_artwork[type] != setup_override_artwork) artwork_new_identifier = artwork_current_identifier;