fix: ComputeNextTiles 正精=翻牌本身(非+1)

南昌麻将规则: 翻到X, 正精=X(翻牌本身), 副精=X+1(9→1循环)
之前错误实现: 正精=X+1, 副精=X+2
修复: 循环从i=0开始(含翻牌本身)

验证: 翻5万→正精5万/副精6万, 翻9筒→正精9筒/副精1筒
This commit is contained in:
xiaoou
2026-07-04 23:45:36 +08:00
parent d734c0a384
commit c1bcdc42a2

View File

@ -66,10 +66,10 @@ public class WildcardRegistry
if (suit == 3) // Honors: 东(31)→南(32)→西(33)→北(34)→中(35)→发(36)→白(37)→东(31) if (suit == 3) // Honors: 东(31)→南(32)→西(33)→北(34)→中(35)→发(36)→白(37)→东(31)
{ {
for (int i = 1; i <= count; i++) for (int i = 0; i < count; i++)
{ {
int next = revealedTile + i; int next = revealedTile + i;
if (next > 37) next = 31 + (next - 38); if (next > 37) next = next - 7; // wrap: 38→31
result.Add(next); result.Add(next);
} }
} }
@ -77,7 +77,7 @@ public class WildcardRegistry
{ {
int baseVal = suit switch { 0 => 0, 1 => 10, _ => 20 }; int baseVal = suit switch { 0 => 0, 1 => 10, _ => 20 };
int rank = MahjongTile.Rank(revealedTile); int rank = MahjongTile.Rank(revealedTile);
for (int i = 1; i <= count; i++) for (int i = 0; i < count; i++)
{ {
int nextRank = (rank + i - 1) % 9 + 1; int nextRank = (rank + i - 1) % 9 + 1;
result.Add(baseVal + nextRank); result.Add(baseVal + nextRank);