Fix HUD-cache updates on Postgres

The value in pdata[p]['position'] is a string. Change the 'pos'
dictionary keys to strings, and to prevent potential breakage on other
databases, always enforce that the looked up key is first converted to
string.
This commit is contained in:
Mika Bostrom 2010-02-27 09:35:18 +02:00
parent 773ba71499
commit 72730291f0

View File

@ -1703,8 +1703,8 @@ class Database:
line[55] = gid # gametypeId
line[56] = pids[p] # playerId
line[57] = len(pids) # activeSeats
pos = {'B':'B', 'S':'S', 0:'D', 1:'C', 2:'M', 3:'M', 4:'M', 5:'E', 6:'E', 7:'E', 8:'E', 9:'E' }
line[58] = pos[pdata[p]['position']]
pos = {'B':'B', 'S':'S', '0':'D', '1':'C', '2':'M', '3':'M', '4':'M', '5':'E', '6':'E', '7':'E', '8':'E', '9':'E' }
line[58] = pos[str(pdata[p]['position'])]
line[59] = pdata[p]['tourneyTypeId']
line[60] = styleKey # styleKey
inserts.append(line)