ctm / mb2-doc

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

ODB Phat Mack didn't get a hand in WSOP-Style 2024 #41 #1351

Closed ctm closed 4 months ago

ctm commented 4 months ago

Figure out why ODB was forced to sit out, even though he had been at the table the entire time.

In event 5186, look for ODB's comment "I didn't get a hand" and also pay attention to where the button was. I was looking elsewhere but I think the button might have jumped. It was, I believe, the first PLO hand of the game, making it a double board bomb pot using the alternate button.

ctm commented 4 months ago

I added the following fix to sit-out-1351, but I haven't actually tested it yet because it's so close to my bedtime. I'll test it and deploy it "soon" (probably tomorrow morning).

[sit-out-1351]% git diff
diff --git a/mb2/src/table.rs b/mb2/src/table.rs
index 4a9fb6cc..1677aa09 100644
--- a/mb2/src/table.rs
+++ b/mb2/src/table.rs
@@ -2154,7 +2154,11 @@ impl Table {

     fn collect_blinds(&mut self) {
         if !self.has_blinds() {
-            self.last_hand_used_button_and_blinds = false;
+            // If we're using the alternate button, then we don't want
+            // to change last_hand_used_button_and_blinds.
+            if !self.use_alt_button() {
+                self.last_hand_used_button_and_blinds = false;
+            }
             return;
         }
         self.last_hand_used_button_and_blinds = true;
@@ -3623,6 +3627,9 @@ impl Table {
     // Bx s b _,     s  busts ->     b _   Bs _
     // Bx s b _,     b  busts ->     b Bs  _  _
     fn assign_blinds(&mut self) {
+        if self.use_alt_button() {
+            return;
+        }
         if !self.last_hand_used_button_and_blinds {
             let mut small_blind = self.next_blindable_seat(self.button_seat());
             if self.n_not_all_in == 2 {
ctm commented 4 months ago

This is sufficient to reproduce the problem, where it occurs in master but is fixed in sit-out-1351:

[sit-out-1351]% git diff
diff --git a/mb2/src/table.rs b/mb2/src/table.rs
index 1677aa09..4e0b0e36 100644
--- a/mb2/src/table.rs
+++ b/mb2/src/table.rs
@@ -5591,6 +5591,11 @@ impl NextActions for Table {
     }

     fn begin_hand_post_shuffle(&mut self) {
+        const DO_NOT_COMMIT: () = ();
+        self.button.seat = 2u8.into();
+        self.button.small_blind = Some(3u8.into());
+        self.alt_button = Some(0u8.into());
+        self.last_hand_used_button_and_blinds = true;
         // This duplicates some code that is called in
         // begin_hand_pre_shuffle because players may have joined via
         // late registration or re-entry since begin_hand_pre_shuffle

I'll merge and deploy now.