From e5a930cea6deda5baea8e6f75230e3cef332b0db Mon Sep 17 00:00:00 2001 From: Treeki Date: Thu, 18 Oct 2012 17:30:04 +0200 Subject: fixed star coin counts --- src/newer.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/newer.cpp b/src/newer.cpp index dd0d99c..dd0dc2c 100644 --- a/src/newer.cpp +++ b/src/newer.cpp @@ -60,11 +60,17 @@ void getNewerLevelNumberString(int world, int level, wchar_t *dest) { } int getUnspentStarCoinCount() { + SaveBlock *save = GetSaveFile()->GetBlock(-1); + int coinsSpent = save->credits_hiscore; + return getStarCoinCount() - coinsSpent; +} + +int getStarCoinCount() { SaveBlock *save = GetSaveFile()->GetBlock(-1); int coinsEarned = 0; for (int w = 0; w < 10; w++) { - for (int l = 0; l < 10; l++) { + for (int l = 0; l < 42; l++) { u32 conds = save->GetLevelCondition(w, l); if (conds & COND_COIN1) { coinsEarned++; } @@ -75,9 +81,3 @@ int getUnspentStarCoinCount() { return coinsEarned; } - -int getStarCoinCount() { - SaveBlock *save = GetSaveFile()->GetBlock(-1); - int coinsSpent = save->credits_hiscore; - return getUnspentStarCoinCount() - coinsSpent; -} -- cgit v1.2.3