Minor simplification of code in date_to_str().
[neverball] / ball / level.c
index 3e68e97..b324655 100644 (file)
@@ -124,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,
@@ -141,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 */