p101 - patch by ryan hayward to handle dead hand before BB

This commit is contained in:
steffen123 2008-09-24 04:37:55 +01:00
parent ba1af89897
commit 7bd16311b1
2 changed files with 12 additions and 1 deletions

View File

@ -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

View File

@ -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
@ -858,6 +859,12 @@ def parsePositions (hand, names):
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)):
while (arraypos>bb):
@ -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":