ctm / mb2-doc

Mb2, poker software
https://devctm.com
7 stars 2 forks source link

Don't remove rebuy controls until the end of the hand #1196

Closed ctm closed 9 months ago

ctm commented 1 year ago

When transitioning from a rebuy level to a non-rebuy level, wait until the hand is over before removing the controls.

See #1195 for more info.

ctm commented 9 months ago

The problem here is that Table sets its tournament_round field when it receives an OnLevel message, but OnLevel doesn't actually take effect until Table::advance_to is called, and that only directly sends a message if that puts us on break, in which case Break is sent. Indirectly, begin_hand_pre_shuffle will be called, and that will give us a Dealing message.

So, the solution is to hold onto the new tournament_round in a different field and only move it into tournament_round when we receive either a Break or a Dealing message.

ctm commented 9 months ago

Done. Deploying now.