From 977e030742425f58a6a0031f02a28f4579cbf6b8 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Thu, 22 Aug 2024 19:42:54 +0200 Subject: [PATCH] changed to more generic approach to use only unscanned BD elements While the previous approach only worked when reading caves from BDCFF files, the new solution works for all cave file formats, as it changes the internal cave structure after loading. --- src/game_bd/bd_cave.c | 4 ---- src/game_bd/bd_caveset.c | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/game_bd/bd_cave.c b/src/game_bd/bd_cave.c index e815806f..93ad63e1 100644 --- a/src/game_bd/bd_cave.c +++ b/src/game_bd/bd_cave.c @@ -281,10 +281,6 @@ void gd_cave_init(void) char *key_1 = getStringToUpper(gd_element_properties[i].filename); int element = i; - // temporary workaround: map scanned elements to their non-scanned counterparts - if (gd_element_properties[i].properties & P_SCANNED) - element = gd_element_properties[i].pair; - if (hashtable_exists(name_to_element, key_1)) // hash value may be 0 Warn("BDCFF token '%s' already used for element 0x%x", key_1, element); diff --git a/src/game_bd/bd_caveset.c b/src/game_bd/bd_caveset.c index 366502d3..20a36049 100644 --- a/src/game_bd/bd_caveset.c +++ b/src/game_bd/bd_caveset.c @@ -251,6 +251,9 @@ GdCave *gd_get_prepared_cave(const GdCave *original_cave, const int level) // initialize some cave variables (like player position) gd_cave_setup_for_game(prepared_cave); + // temporary workaround: set all elements in a cave to their non-scanned counterparts + unscan_cave(prepared_cave); + return prepared_cave; } -- 2.34.1