Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #27 from MahjongPantheon/TYR-25-fix-fu-count
Browse files Browse the repository at this point in the history
TYR-25 default to 30fu when open hand is added
  • Loading branch information
Oleg Klimenko authored May 7, 2017
2 parents 1870a08 + ba2e8b3 commit 9ce91b3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/primitives/appstate/yaku.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,13 @@ function _addYakuToProps(outcome: AppOutcome, id: YakuId, props: WinProps, bypas
props.yaku = addYakuToList(id, props.yaku);
props.han = getHan(props.yaku);
props.possibleFu = getFixedFu(props.yaku, outcome.selectedOutcome);
if (-1 === props.possibleFu.indexOf(props.fu)) {
if (
-1 === props.possibleFu.indexOf(props.fu) ||
id === YakuId.__OPENHAND // if open hand added, 40 fu must become 30 by default
) {
props.fu = props.possibleFu[0];
}

return true;
}

Expand All @@ -127,6 +131,7 @@ export function addYaku(outcome: AppOutcome, id: YakuId, mrWinner: number, bypas
removeYaku(outcome, YakuId.MENZENTSUMO, mrWinner);
}
}

break;
case 'multiron':
let props = outcome.wins[mrWinner];
Expand Down

0 comments on commit 9ce91b3

Please sign in to comment.