手役计算错误
Closed this issue · 0 comments
zyr17 commented
mahjong/Mahjong/ScoreCounter.cpp
Lines 374 to 386 in 88081e3
纯老头和纯绿牌两个函数判断不正确,导致混老头会被误认为清老头,以及无法识别绿一色。
混老头例:https://tenhou.net/5/?log=2019051522gm-00a9-0000-8c64c236 南三局0本场
绿一色例:https://tenhou.net/5/?log=2019061604gm-00a9-0000-55019a3a 南一局1本场
/* 牌型对/刻/杠,全幺九,不包括字牌,例如999p 1111m */
bool 纯老头(const string &s) {
if (s[2] == 'K' || s[2] == ':' || s[2] == '|') return (s[0] == '1' || s[0] == '9') && s[1] != 'z';
return false;
}
bool 纯绿牌(const string &s) {
const char* green_types[] = {"2sK", "3sK", "4sK", "2sS", "6sK", "8sK", "6zK",
"2s:", "3s:", "4s:", "6s:", "8s:", "6z:", "2s|", "3s|", "4s|", "6s|", "8s|", "6z|", };
return any_of(begin(green_types), end(green_types),
[&s](const char* green) {return tile_group_match(s, green); });
}