From c1bcdc42a26d69ca06d4f94c6c28cf502f2cc552 Mon Sep 17 00:00:00 2001 From: xiaoou Date: Sat, 4 Jul 2026 23:45:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20ComputeNextTiles=20=E6=AD=A3=E7=B2=BE=3D?= =?UTF-8?q?=E7=BF=BB=E7=89=8C=E6=9C=AC=E8=BA=AB(=E9=9D=9E+1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 南昌麻将规则: 翻到X, 正精=X(翻牌本身), 副精=X+1(9→1循环) 之前错误实现: 正精=X+1, 副精=X+2 修复: 循环从i=0开始(含翻牌本身) 验证: 翻5万→正精5万/副精6万, 翻9筒→正精9筒/副精1筒 --- RuleEngine/Core/WildcardRegistry.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RuleEngine/Core/WildcardRegistry.cs b/RuleEngine/Core/WildcardRegistry.cs index 46f9a95..044a7e4 100644 --- a/RuleEngine/Core/WildcardRegistry.cs +++ b/RuleEngine/Core/WildcardRegistry.cs @@ -66,10 +66,10 @@ public class WildcardRegistry 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; - if (next > 37) next = 31 + (next - 38); + if (next > 37) next = next - 7; // wrap: 38→31 result.Add(next); } } @@ -77,7 +77,7 @@ public class WildcardRegistry { int baseVal = suit switch { 0 => 0, 1 => 10, _ => 20 }; 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; result.Add(baseVal + nextRank);