diff --git a/docs/known-bugs-and-planned-features.txt b/docs/known-bugs-and-planned-features.txt index 17ef57f4..a9bebe40 100644 --- a/docs/known-bugs-and-planned-features.txt +++ b/docs/known-bugs-and-planned-features.txt @@ -97,6 +97,7 @@ verify at least 2 or 3 sng hands no rush but before 1.0RC ======================== +improve handling of dead hand before BB, see git101/ make DB version error offer reimport, recreation and continue. In many places there are unnecessary database accesses or it regenerates information it already had before or just generally does things in obscenely inefficient ways. Optimise this multi-select in bulk importer diff --git a/pyfpdb/fpdb_simple.py b/pyfpdb/fpdb_simple.py index f8fa6524..d94f1c81 100644 --- a/pyfpdb/fpdb_simple.py +++ b/pyfpdb/fpdb_simple.py @@ -53,7 +53,8 @@ def checkPositions(positions): except TypeError:#->not string->is int->fine pass - if (pos!="B" and pos!="S" and pos!=0 and pos!=1 and pos!=2 and pos!=3 and pos!=4 and pos!=5 and pos!=6 and pos!=7): + ### RHH modified to allow for "position 9" here (pos==9 is when you're a dead hand before the BB + if (pos!="B" and pos!="S" and pos!=0 and pos!=1 and pos!=2 and pos!=3 and pos!=4 and pos!=5 and pos!=6 and pos!=7 and pos!=9): raise FpdbError("invalid position found in checkPositions. i: "+str(i)+" position: "+str(pos)) #end def fpdb_simple.checkPositions @@ -857,6 +858,12 @@ def parsePositions (hand, names): positions[arraypos]=distFromBtn arraypos-=1 distFromBtn+=1 + + ### RHH - Changed to set the null seats before BB to "9" + i=bb-1 + while positions[i] < 0: + positions[i]=9 + i-=1 arraypos=len(names)-1 if (bb!=0 or (bb==0 and sbExists==False)): @@ -1563,6 +1570,9 @@ def generateHudCacheData(player_ids, base, category, action_types, actionTypeByN hudDataPositions.append('M') elif pos>=5 and pos<=7: hudDataPositions.append('L') + ### RHH Added this elif to handle being a dead hand before the BB (pos==9) + elif pos==9: + hudDataPositions.append('X') else: raise FpdbError("invalid position") elif base=="stud":