From 670efe66454429bfbca6a179ba278ae69f23b624 Mon Sep 17 00:00:00 2001 From: skizzerz Date: Wed, 25 Apr 2018 17:53:03 -0500 Subject: [PATCH] Fix recording role stats --- src/db.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/db.py b/src/db.py index 3268a34..4946c7f 100644 --- a/src/db.py +++ b/src/db.py @@ -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) VALUES (?, ?, ?, ?, ?)""", (gameid, p["playerid"], p["won"], p["iwon"], p["dced"])) gpid = c.lastrowid - c.execute("""INSERT INTO game_player_role (game_player, role, special) - VALUES (?, ?, 0)""", (gpid, p["role"])) - for tpl in p["templates"]: + for role in p["allroles"]: c.execute("""INSERT INTO game_player_role (game_player, role, special) - VALUES (?, ?, 0)""", (gpid, tpl)) + VALUES (?, ?, 0)""", (gpid, role)) for sq in p["special"]: c.execute("""INSERT INTO game_player_role (game_player, role, special) VALUES (?, ?, 1)""", (gpid, sq))