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
|
# Assign position = one more than the current max for this town's pending build queue
|
||||||
if cmd_type == 'build':
|
if cmd_type == 'build':
|
||||||
pos_row = c.execute('''
|
pos_row = c.execute(
|
||||||
SELECT MAX(position) as max_pos FROM commands
|
"SELECT MAX(position) as max_pos FROM commands"
|
||||||
WHERE player_id = ? AND town_id = ? AND type = 'build' AND status IN (''pending'', ''executing'')
|
" WHERE player_id = ? AND town_id = ? AND type = 'build'"
|
||||||
''', (str(data['player_id']), str(data['town_id']))).fetchone()
|
" AND status IN ('pending', 'executing')",
|
||||||
|
(str(data['player_id']), str(data['town_id']))
|
||||||
|
).fetchone()
|
||||||
position = (pos_row['max_pos'] or 0) + 1
|
position = (pos_row['max_pos'] or 0) + 1
|
||||||
else:
|
else:
|
||||||
position = None
|
position = None
|
||||||
|
|||||||
Reference in New Issue
Block a user