function settleGameCommon(Game storage bet, uint reveal, bytes32 entropyBlockHash) private {
        uint amount = bet.amount;
        uint rollUnder = bet.rollUnder;
        address player = bet.player;

        require (amount != 0, "Game should be in an 'active' state");
        bet.amount = 0;

        bytes32 seed = keccak256(abi.encodePacked(reveal, entropyBlockHash));

        uint dice = uint(seed) % 100 + 1;
        
        emit ShowResult(reveal, dice);

        uint diceWinAmount;
        uint inviteProfit;
        
        (diceWinAmount, inviteProfit) = getDiceWinAmount(amount, rollUnder, bet.inviter);

        uint diceWin = 0;
        
        if (dice <= rollUnder) {
            diceWin = diceWinAmount;
        }
        lockedInBets -= uint128(diceWinAmount);
        inviteProfits[bet.inviter] += inviteProfit;
        
        bet.finished = true;
        sendFunds(player, diceWin);
    }