fix 1
This commit is contained in:
@@ -377,10 +377,12 @@ def create_command():
|
||||
|
||||
# Assign position = one more than the current max for this town's pending build queue
|
||||
if cmd_type == 'build':
|
||||
pos_row = c.execute('''
|
||||
SELECT MAX(position) as max_pos FROM commands
|
||||
WHERE player_id = ? AND town_id = ? AND type = 'build' AND status IN (''pending'', ''executing'')
|
||||
''', (str(data['player_id']), str(data['town_id']))).fetchone()
|
||||
pos_row = c.execute(
|
||||
"SELECT MAX(position) as max_pos FROM commands"
|
||||
" WHERE player_id = ? AND town_id = ? AND type = 'build'"
|
||||
" AND status IN ('pending', 'executing')",
|
||||
(str(data['player_id']), str(data['town_id']))
|
||||
).fetchone()
|
||||
position = (pos_row['max_pos'] or 0) + 1
|
||||
else:
|
||||
position = None
|
||||
|
||||
Reference in New Issue
Block a user