Skip to content

Commit

Permalink
Merge pull request #23 from DaoCasino/dpm-849-prohibit-additional-dep…
Browse files Browse the repository at this point in the history
…osit-by-default

[DPM-849] prohibit additional deposits by default
  • Loading branch information
justefg authored Nov 6, 2020
2 parents 1e5f455 + 0aaf9a0 commit 4ca52ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions contracts/src/blackjack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ void blackjack::on_action(uint64_t ses_id, uint16_t type, std::vector<game_sdk::
if (state_itr->has_split() && !state_itr->second_round) {
eosio::print("player stands and swaps active cards\n");
finish_first_round(state_itr);
require_action(action::play);
require_action(action::play, true);
return;
}
update_state(state_itr, game_state::stand);
Expand Down Expand Up @@ -287,7 +287,7 @@ void blackjack::on_random(uint64_t ses_id, checksum256 rand) {
end_game(ses_id, 3 * ante / 2 + side_bets_win, std::move(dealer_cards), std::move(player_cards));
return;
}
require_action(action::play);
require_action(action::play, true);
update_state(state_itr, game_state::require_play);
update_max_win(ses_id, -4 * bet_itr->pair - 25 * bet_itr->first_three + side_bets_win);
send_game_message(std::vector<param_t>{player_cards[0].get_value(), player_cards[1].get_value(), dealer_cards[0].get_value()});
Expand All @@ -305,7 +305,7 @@ void blackjack::on_random(uint64_t ses_id, checksum256 rand) {
finish_first_round(state_itr);
}
}
require_action(action::play);
require_action(action::play, true);
update_state(state_itr, game_state::require_play);
// if player has 2 cards and hasn't split it means it's his first action in the game
if (!state_itr->has_split() && state_itr->active_cards.size() == 2) {
Expand All @@ -331,7 +331,7 @@ void blackjack::on_random(uint64_t ses_id, checksum256 rand) {
}
send_game_message(std::vector<param_t>{player_card.get_value()});
update_state(state_itr, game_state::require_play);
require_action(action::play);
require_action(action::play, true);
break;
}
case game_state::stand: {
Expand Down Expand Up @@ -364,7 +364,7 @@ void blackjack::on_random(uint64_t ses_id, checksum256 rand) {
ncard2.get_value()
});
update_state(state_itr, game_state::require_play);
require_action(action::play);
require_action(action::play, true);
} else {
// In most casinos the player is only allowed to draw one card on each split ace
// As a general rule, a ten on a split ace (or vice versa) is not considered a natural blackjack and does not get any bonus
Expand Down

0 comments on commit 4ca52ee

Please sign in to comment.