changed handling artwork info cache to allow partial (default) entries
authorHolger Schemel <info@artsoft.org>
Fri, 24 Nov 2017 20:12:42 +0000 (21:12 +0100)
committerHolger Schemel <info@artsoft.org>
Fri, 23 Mar 2018 22:21:16 +0000 (23:21 +0100)
src/libgame/setup.c

index f28df34f30713cc103e0ce83b88a854fb85fd243..f2f5984f702ce2947bfa4c77bc4a4b1ff9086f8b 100644 (file)
@@ -2820,22 +2820,13 @@ static TreeInfo *getArtworkInfoCacheEntry(LevelDirTree *level_node, int type)
       char *token = getCacheToken(token_prefix, artworkinfo_tokens[i].text);
       char *value = getHashEntry(artworkinfo_cache_old, token);
 
-      setSetupInfo(artworkinfo_tokens, i, value);
-
-      /* check if cache entry for this item is invalid or incomplete */
-      if (value == NULL)
-      {
-       Error(ERR_WARN, "cache entry '%s' invalid", token);
-
-       cached = FALSE;
-      }
+      /* if defined, use value from cache, else keep default value */
+      if (value != NULL)
+       setSetupInfo(artworkinfo_tokens, i, value);
     }
 
     *artwork_info = ldi;
-  }
 
-  if (cached)
-  {
     char *filename_levelinfo = getPath2(getLevelDirFromTreeInfo(level_node),
                                        LEVELINFO_FILENAME);
     char *filename_artworkinfo = getPath2(getSetupArtworkDir(artwork_info),