forked from rDrama/rDrama
fix bug in casino slots + change return value
parent
47ac6e12db
commit
a18c2e24e9
|
@ -46,9 +46,9 @@ def casino_slot_pull(gambler, wager_value, currency):
|
||||||
casino_game.game_state = json.dumps(game_state)
|
casino_game.game_state = json.dumps(game_state)
|
||||||
g.db.add(casino_game)
|
g.db.add(casino_game)
|
||||||
|
|
||||||
return True, casino_game.game_state
|
return casino_game.id, casino_game.game_state
|
||||||
else:
|
else:
|
||||||
return False, "{}"
|
return 0, "{}",
|
||||||
|
|
||||||
|
|
||||||
def build_symbols(for_payout):
|
def build_symbols(for_payout):
|
||||||
|
|
|
@ -95,10 +95,11 @@ def pull_slots(v):
|
||||||
except:
|
except:
|
||||||
abort(400, "Invalid currency (expected 'coin' or 'marseybux').")
|
abort(400, "Invalid currency (expected 'coin' or 'marseybux').")
|
||||||
|
|
||||||
if (currency == "coin" and wager > v.coins) or (currency == "marseybux" and wager > v.procoins):
|
if (currency == "coins" and wager > v.coins) or (currency == "procoins" and wager > v.procoins):
|
||||||
abort(400, f"Not enough {currency} to make that bet")
|
abort(400, f"Not enough {currency} to make that bet")
|
||||||
|
|
||||||
success, game_state = casino_slot_pull(v, wager, currency)
|
game_id, game_state = casino_slot_pull(v, wager, currency)
|
||||||
|
success = bool(game_id)
|
||||||
|
|
||||||
if success:
|
if success:
|
||||||
return {"game_state": game_state, "gambler": {"coins": v.coins, "procoins": v.procoins}}
|
return {"game_state": game_state, "gambler": {"coins": v.coins, "procoins": v.procoins}}
|
||||||
|
|
Loading…
Reference in New Issue