diff options
author | Treeki <treeki@gmail.com> | 2012-10-18 17:30:04 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-10-18 17:30:04 +0200 |
commit | e5a930cea6deda5baea8e6f75230e3cef332b0db (patch) | |
tree | 7cf74d5a55a4d26bc314f633626ce98f225a2b6d | |
parent | ad9c966a11bac1955529dce574d90d708a2f8704 (diff) | |
download | kamek-e5a930cea6deda5baea8e6f75230e3cef332b0db.tar.gz kamek-e5a930cea6deda5baea8e6f75230e3cef332b0db.zip |
fixed star coin counts
-rw-r--r-- | src/newer.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/newer.cpp b/src/newer.cpp index dd0d99c..dd0dc2c 100644 --- a/src/newer.cpp +++ b/src/newer.cpp @@ -61,10 +61,16 @@ 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; -} |