mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-19 12:18:59 +00:00
Check sufficient hourglasses when attempting to purchase
This commit is contained in:
parent
807c00f30b
commit
3d3fd97fe0
1 changed files with 1 additions and 0 deletions
|
|
@ -74,6 +74,7 @@ open class ShopItem : RealmObject(), BaseObject {
|
|||
fun canAfford(user: User?, quantity: Int): Boolean = when (currency) {
|
||||
"gold" -> (value * quantity) <= (user?.stats?.gp ?: 0.0)
|
||||
"gems" -> (value * quantity) <= (user?.gemCount ?: 0)
|
||||
"hourglasses" -> (value * quantity) <= (user?.hourglassCount ?: 0)
|
||||
else -> true
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue