forked from rDrama/rDrama
fix combined buy btn
parent
562388de65
commit
d136ae163c
|
@ -81,8 +81,8 @@ def buy(v:User, award):
|
||||||
else:
|
else:
|
||||||
currency = 'combined'
|
currency = 'combined'
|
||||||
|
|
||||||
charged = v.charge_account(currency, price)[0]
|
charged = v.charge_account(currency, price)
|
||||||
if not charged:
|
if not charged[0]:
|
||||||
abort(400, "Not enough coins/marseybux!")
|
abort(400, "Not enough coins/marseybux!")
|
||||||
|
|
||||||
v.coins_spent += charged[1]
|
v.coins_spent += charged[1]
|
||||||
|
|
|
@ -47,8 +47,9 @@ def buy_hat(v:User, hat_id):
|
||||||
if not hat.is_purchasable:
|
if not hat.is_purchasable:
|
||||||
abort(403, "This hat is not for sale!")
|
abort(403, "This hat is not for sale!")
|
||||||
|
|
||||||
charged = v.charge_account('combined', hat.price)[0]
|
charged = v.charge_account('combined', hat.price)
|
||||||
if not charged: abort(400, "Not enough coins/marseybux!")
|
if not charged[0]:
|
||||||
|
abort(400, "Not enough coins/marseybux!")
|
||||||
|
|
||||||
v.coins_spent_on_hats += charged[1]
|
v.coins_spent_on_hats += charged[1]
|
||||||
hat.author.pay_account('coins', hat.price * 0.1)
|
hat.author.pay_account('coins', hat.price * 0.1)
|
||||||
|
|
Loading…
Reference in New Issue