From abd98726fe85391e6ccd3e4a75bab5f6a97cea65 Mon Sep 17 00:00:00 2001 From: KCFindstr <792491320@qq.com> Date: Sun, 4 Jun 2023 23:26:46 -0700 Subject: [PATCH] Fix: Use tile fridge in Chankan calculation. --- Events/InGame/Listener/AddKanListener.cs | 2 -- Events/InGame/Listener/KanListener.cs | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Events/InGame/Listener/AddKanListener.cs b/Events/InGame/Listener/AddKanListener.cs index 354a72c..20ceee1 100644 --- a/Events/InGame/Listener/AddKanListener.cs +++ b/Events/InGame/Listener/AddKanListener.cs @@ -7,8 +7,6 @@ namespace RabiRiichi.Events.InGame.Listener { public static class AddKanListener { private static Task ExecuteAddKan(AddKanEvent ev) { - // Remove fake discard info - ev.incoming.discardInfo = null; if (ev.kanSource == TileSource.Ankan || ev.kanSource == TileSource.Daiminkan) { ev.player.hand.AddKan(ev.kan); } else if (ev.kanSource == TileSource.Kakan) { diff --git a/Events/InGame/Listener/KanListener.cs b/Events/InGame/Listener/KanListener.cs index 30a0a32..1bdad6f 100644 --- a/Events/InGame/Listener/KanListener.cs +++ b/Events/InGame/Listener/KanListener.cs @@ -9,6 +9,7 @@ namespace RabiRiichi.Events.InGame.Listener { public static class KanListener { public static Task ExecuteKan(KanEvent ev) { // Pretend that kan tile is discarded to resolve chankan, and recover state later + using var _ = ev.incoming.Freeze(); ev.player.hand.Play(ev.incoming, DiscardReason.Chankan); // Resolve chankan @@ -24,7 +25,7 @@ public static Task ExecuteKan(KanEvent ev) { // 若有人抢杠,杠在荣和后成立 var addKanEvent = new AddKanEvent(ev); ev.Q.Queue(addKanEvent); - // 若游戏进入下一局,不要执行抢杠事件 + // 若游戏进入下一局,不要执行添加杠事件 ev.bus.Subscribe((e) => { addKanEvent.Cancel(); return Task.CompletedTask;