Fix recording role stats

This commit is contained in:
skizzerz 2018-04-25 17:53:03 -05:00
parent 022da467ec
commit 670efe6645

View File

@ -293,11 +293,9 @@ def add_game(mode, size, started, finished, winner, players, options):
c.execute("""INSERT INTO game_player (game, player, team_win, indiv_win, dced) c.execute("""INSERT INTO game_player (game, player, team_win, indiv_win, dced)
VALUES (?, ?, ?, ?, ?)""", (gameid, p["playerid"], p["won"], p["iwon"], p["dced"])) VALUES (?, ?, ?, ?, ?)""", (gameid, p["playerid"], p["won"], p["iwon"], p["dced"]))
gpid = c.lastrowid gpid = c.lastrowid
c.execute("""INSERT INTO game_player_role (game_player, role, special) for role in p["allroles"]:
VALUES (?, ?, 0)""", (gpid, p["role"]))
for tpl in p["templates"]:
c.execute("""INSERT INTO game_player_role (game_player, role, special) c.execute("""INSERT INTO game_player_role (game_player, role, special)
VALUES (?, ?, 0)""", (gpid, tpl)) VALUES (?, ?, 0)""", (gpid, role))
for sq in p["special"]: for sq in p["special"]:
c.execute("""INSERT INTO game_player_role (game_player, role, special) c.execute("""INSERT INTO game_player_role (game_player, role, special)
VALUES (?, ?, 1)""", (gpid, sq)) VALUES (?, ?, 1)""", (gpid, sq))