fix: GetOutCard 集成 — bot 出牌类型不再硬编码 DanZhang
根因: MakePlay 永远设 Type=DanZhang,bot 路径跳过 GetOutCard 校验, 导致多牌组合(对子/顺子等)被错误标为单张。 修复: - MakePlay: Type=DanZhang → Type=None(占位,等引擎赋值) - WaitWanJiaShuRu case4: bot 有Ids时通过 GetOutCard 获取正确牌型 - payCard.Pos 补设(GetOutCard 输出 Pos 默认为0) - ISMCTS 日志: 按 Ids 为空判断 pass,而非 Type 现在游戏日志正确显示: type:DanZhang/type:None/type:DuiZi 等
This commit is contained in:
@ -690,7 +690,22 @@ namespace PdkFriendServer.Logic
|
||||
{
|
||||
var view = BuildBotView(pos);
|
||||
var botPlay = _bots[pos - 1].DecidePlay(view);
|
||||
GamePack.Info.ActivePlayCard = botPlay;
|
||||
// 非pass(有Ids)则运行 GetOutCard 获取正确牌型,pass(Type=None且Ids为空)直接设
|
||||
if (botPlay.Ids != null && botPlay.Ids.Length > 0)
|
||||
{
|
||||
var hand = view.MyHand;
|
||||
var selectCards = hand.Where(c => botPlay.Ids.Contains(c.ID)).ToArray();
|
||||
if (selectCards.Length > 0)
|
||||
{
|
||||
PdkCardAlgorithm.GetOutCard(selectCards, hand, Rule, out var payCard);
|
||||
payCard.Pos = (byte)pos;
|
||||
GamePack.Info.ActivePlayCard = payCard;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GamePack.Info.ActivePlayCard = botPlay;
|
||||
}
|
||||
return;
|
||||
}
|
||||
// 人工输入
|
||||
|
||||
Reference in New Issue
Block a user