forked from rDrama/rDrama
1
0
Fork 0

fix bug in casino slots + change return value

master
Aevann1 2022-10-30 02:12:32 +02:00
parent 47ac6e12db
commit a18c2e24e9
2 changed files with 5 additions and 4 deletions

View File

@ -46,9 +46,9 @@ def casino_slot_pull(gambler, wager_value, currency):
casino_game.game_state = json.dumps(game_state)
g.db.add(casino_game)
return True, casino_game.game_state
return casino_game.id, casino_game.game_state
else:
return False, "{}"
return 0, "{}",
def build_symbols(for_payout):

View File

@ -95,10 +95,11 @@ def pull_slots(v):
except:
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")
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:
return {"game_state": game_state, "gambler": {"coins": v.coins, "procoins": v.procoins}}