Finish decompiling coins
This commit is contained in:
21
src/coins.c
21
src/coins.c
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user