Change the "special" attribute name to "bonus" to fit the meaning of
[neverball] / ball / level.c
index 2037b89..c009fa4 100644 (file)
@@ -102,7 +102,7 @@ static int level_scan_metadata(struct level *l, char *av)
             strcpy(l->version, v);
         else if (CASE("author"))
             strcpy(l->author, v);
-        else if (CASE("special"))
+        else if (CASE("bonus"))
             l->is_bonus = atoi(v);
 
         c = e;
@@ -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 */