ctm / mb2-doc

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

SOHE labeled as "Five Card Stud" #1427

Closed ctm closed 1 month ago

ctm commented 1 month ago

Fix the bug that is causing SOHE to be labled "Five Card Stud".

I suspect it's a copy-and-paste error from when I did all the work on shifting Display to Options (#1399).

ctm commented 1 month ago

Sure enough:


    fn fmt_simultaneous(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
        write!(f, "{} (High only)", GameType::FiveCardStud)
    }
``
ctm commented 1 month ago

Fixed in master:

diff --git a/lib/commands/src/types.rs b/lib/commands/src/types.rs
index 515ea8d8..ef8e6cf0 100644
--- a/lib/commands/src/types.rs
+++ b/lib/commands/src/types.rs
@@ -1355,7 +1355,7 @@ impl Options {
     }

     fn fmt_simultaneous(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
-        write!(f, "{} (High only)", GameType::FiveCardStud)
+        write!(f, "{} (High only)", GameType::Simultaneous)
     }
 }

I'll deploy after this evening's tournament is over. I checked all the other fmt_* methods and they're OK. SOHE just happened to be the fourth out of four exceedingly similar methods and apparently I used the one for five card stud as a template that I copied and pasted, then edited and I accidentally didn't completely edit the last one, changing it from fmt_five_card_stud to fmt_simultaneous but leaving GameType::FiveCardStud.