Minor simplification of code in date_to_str().
[neverball] / ball / level.c
index 44c2fe5..b324655 100644 (file)
@@ -98,8 +98,6 @@ static int level_scan_metadata(struct level *l, char *av)
             sscanf(v, "%d %d",
                    &l->score.most_coins.coins[0],
                    &l->score.most_coins.coins[1]);
-        else if (CASE("levelname"))
-            strcpy(l->levelname, v);
         else if (CASE("version"))
             strcpy(l->version, v);
         else if (CASE("author"))
@@ -126,7 +124,7 @@ int level_load(const char *filename, struct level *level)
     memset(&sol,  0, sizeof (sol));
 
     /* Try to load the sol file */
-    if (!sol_load_only_head(&sol, filename))
+    if (!sol_load_only_head(&sol, config_data(filename)))
     {
         fprintf(stderr,
                 _("Error while loading level file '%s': %s\n"), filename,
@@ -143,8 +141,9 @@ int level_load(const char *filename, struct level *level)
 
     /* Compute money and default max money */
     money = 0;
-    for (i = 0; i < sol.cc; i++)
-        money += sol.cv[i].n;
+    for (i = 0; i < sol.hc; i++)
+        if (sol.hv[i].t == ITEM_COIN)
+            money += sol.hv[i].n;
     level->score.most_coins.coins[0] = money;
 
     /* Scan sol metadata */