fixed compatibility handling for redefined old graphic "global.door"
authorHolger Schemel <info@artsoft.org>
Tue, 12 Apr 2022 20:48:54 +0000 (22:48 +0200)
committerHolger Schemel <info@artsoft.org>
Tue, 12 Apr 2022 20:57:54 +0000 (22:57 +0200)
If old graphic "global.door" is redefined, all individual definitions
accessing the same image file are changed to use the redefined image.

However, this did not work correctly for graphic definitions which are
cloned from other graphic definitions which are itself redefined and
do not use the same graphic as "global.door" anymore. In this case, do
not change these cloned graphics to use the redefined "global.door".

src/init.c

index dbba5f1250154305c8c1412d8ab0255326a72907..b2b93715e3cee12b0aaac719781a5843af10ecfd 100644 (file)
@@ -1930,6 +1930,16 @@ static void InitGraphicCompatibilityInfo(void)
        // process all images which default to same image as "global.door"
        if (strEqual(fi->default_filename, fi_global_door->default_filename))
        {
+         // skip all images that are cloned from images that default to same
+         // image as "global.door", but that are redefined to something else
+         if (graphic_info[i].clone_from != -1)
+         {
+           int cloned_graphic = graphic_info[i].clone_from;
+
+           if (getImageListEntryFromImageID(cloned_graphic)->redefined)
+             continue;
+         }
+
 #if 0
          Debug("init:InitGraphicCompatibilityInfo",
                "special treatment needed for token '%s'", fi->token);