@@ -200,22 +200,22 @@ def aotenjou_filter_yaku(hand_yaku: MutableSequence[Yaku] | MutableSet[Yaku], co
200200 # for daisuushi we need to remove toitoi
201201 hand_yaku .remove (config .yaku .toitoi )
202202
203- if config .yaku .suuankou in hand_yaku or config .yaku .suuankou_tanki in hand_yaku :
203+ if (
204+ config .yaku .suuankou in hand_yaku or config .yaku .suuankou_tanki in hand_yaku
205+ ) and config .yaku .toitoi in hand_yaku :
204206 # for suu ankou we need to remove toitoi and sanankou (sanankou is already removed by default)
205- if config .yaku .toitoi in hand_yaku :
206- # toitoi is "optional" in closed suukantsu, maybe a bug? or toitoi is not given when it's kans?
207- hand_yaku .remove (config .yaku .toitoi )
207+ # toitoi is "optional" in closed suukantsu, maybe a bug? or toitoi is not given when it's kans?
208+ hand_yaku .remove (config .yaku .toitoi )
208209
209210 if config .yaku .chinroto in hand_yaku :
210211 # for chinroto we need to remove toitoi and honroto
211212 hand_yaku .remove (config .yaku .toitoi )
212213 hand_yaku .remove (config .yaku .honroto )
213214
214- if config .yaku .suukantsu in hand_yaku :
215+ if config .yaku .suukantsu in hand_yaku and config . yaku . toitoi in hand_yaku :
215216 # for suukantsu we need to remove toitoi and sankantsu (sankantsu is already removed by default)
216- if config .yaku .toitoi in hand_yaku :
217- # same as above?
218- hand_yaku .remove (config .yaku .toitoi )
217+ # same as above?
218+ hand_yaku .remove (config .yaku .toitoi )
219219
220220 if config .yaku .chuuren_poutou in hand_yaku or config .yaku .daburu_chuuren_poutou in hand_yaku :
221221 # for chuuren poutou we need to remove chinitsu
@@ -232,7 +232,6 @@ def aotenjou_filter_yaku(hand_yaku: MutableSequence[Yaku] | MutableSet[Yaku], co
232232 if config .yaku .chiitoitsu in hand_yaku :
233233 hand_yaku .remove (config .yaku .chiitoitsu )
234234
235- if config .yaku .ryuisou in hand_yaku :
235+ if config .yaku .ryuisou in hand_yaku and config . yaku . honitsu in hand_yaku :
236236 # for ryuisou we need to remove honitsu, if it is there
237- if config .yaku .honitsu in hand_yaku :
238- hand_yaku .remove (config .yaku .honitsu )
237+ hand_yaku .remove (config .yaku .honitsu )
0 commit comments