ishikota / PyPokerEngine

Poker engine for poker AI development in Python
https://ishikota.github.io/PyPokerEngine/
MIT License
608 stars 184 forks source link

Fix the bug of remove player before game #50

Closed ishikota closed 7 years ago

ishikota commented 7 years ago

Bug situation

RoundManager failed to correct ante from player.

ValueError: Failed to collect 1000 chips. Because he has only 475 chips

The player who cannot pay forced bet should be removed before start the game by dealer. But dealer didn't remove him.

How to reproduce bug situation

sb_amount = 5, ante = 20 p1.stack = 100 (small blind) p2.stack = 100 (big blind) p3.stack = 19 (dealer button)

dealer.__exclude_short_of_money_players method doesn't disable p3. So RoundManager try to correct ante from p3 and crashes.

coveralls commented 7 years ago

Coverage Status

Coverage increased (+0.006%) to 97.855% when pulling c7ab0cf384cc5b231d0a3aae31ae2a6131a47629 on bug-fix-remove-player-logic into 3ae6b6c70356eb17f28328663d9f28f342bc7382 on 0.1.3.