Finish decompiling coins

This commit is contained in:
PikalaxALT
2017-11-23 13:53:51 -05:00
parent 1e4f12e6fa
commit 89d938ea9e
3 changed files with 16 additions and 80 deletions

View File

@@ -53,7 +53,6 @@ void SetCoins(u16 coinAmount)
gSaveBlock1Ptr->coins = coinAmount ^ gSaveBlock2Ptr->encryptionKey;
}
/* Can't match it lol
bool8 GiveCoins(u16 toAdd)
{
u16 newAmount;
@@ -67,10 +66,22 @@ bool8 GiveCoins(u16 toAdd)
}
else
{
newAmount = ownedCoins + toAdd;
if (newAmount > MAX_COINS)
newAmount = MAX_COINS;
ownedCoins += toAdd;
if (ownedCoins > MAX_COINS)
ownedCoins = MAX_COINS;
newAmount = ownedCoins;
}
SetCoins(newAmount);
return TRUE;
}*/
}
bool8 TakeCoins(u16 toSub)
{
u16 ownedCoins = GetCoins();
if (ownedCoins >= toSub)
{
SetCoins(ownedCoins - toSub);
return TRUE;
}
return FALSE;
}