redo changes to parsePositions

This commit is contained in:
eblade 2008-12-18 15:40:28 -05:00
parent 6e1499fb69
commit 9263aa998e

View File

@ -1229,11 +1229,17 @@ def parsePositions (hand, names):
if (bb!=-1): if (bb!=-1):
bb=recognisePlayerNo(bb, names, "bet") bb=recognisePlayerNo(bb, names, "bet")
# print "sb = ", sb, "bb = ", bb
if bb == sb:
sbExists = False
sb = -1
#write blinds into array #write blinds into array
if (sbExists): if (sbExists):
positions[sb]="S" positions[sb]="S"
positions[bb]="B" positions[bb]="B"
#fill up rest of array #fill up rest of array
if (sbExists): if (sbExists):
arraypos=sb-1 arraypos=sb-1
@ -1246,15 +1252,24 @@ def parsePositions (hand, names):
arraypos-=1 arraypos-=1
distFromBtn+=1 distFromBtn+=1
# eric - this takes into account dead seats between blinds
if sbExists:
i = bb - 1
while positions[i] < 0 and i != sb:
positions[i] = 9
i -= 1
### RHH - Changed to set the null seats before BB to "9" ### RHH - Changed to set the null seats before BB to "9"
if sbExists:
i = sb-1
else:
i = bb-1 i = bb-1
while positions[i] < 0: while positions[i] < 0:
positions[i]=9 positions[i]=9
i-=1 i-=1
arraypos=len(names)-1 arraypos=len(names)-1
if (bb!=0 or (bb==0 and sbExists==False)): if (bb!=0 or (bb==0 and sbExists==False) or (bb == 1 and sb != arraypos) ):
while (arraypos>bb): while (arraypos>bb and arraypos > sb):
positions[arraypos]=distFromBtn positions[arraypos]=distFromBtn
arraypos-=1 arraypos-=1
distFromBtn+=1 distFromBtn+=1
@ -1264,6 +1279,7 @@ def parsePositions (hand, names):
print "parsePositions names:",names print "parsePositions names:",names
print "result:",positions print "result:",positions
raise FpdbError ("failed to read positions") raise FpdbError ("failed to read positions")
# print str(positions), "\n"
return positions return positions
#end def parsePositions #end def parsePositions