From: Holger Schemel Date: Thu, 22 Aug 2024 17:42:54 +0000 (+0200) Subject: changed to more generic approach to use only unscanned BD elements X-Git-Tag: 4.4.0.0-test-4~298 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=977e030742425f58a6a0031f02a28f4579cbf6b8;p=rocksndiamonds.git 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. --- 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; }