From: Steinar H. Gunderson Date: Sun, 20 Feb 2005 17:15:53 +0000 (+0000) Subject: Correct the logic for finding out what songs a player can choose (only random songs... X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=f0955c93464993b82d087f48150d363c6c57054f Correct the logic for finding out what songs a player can choose (only random songs in the same parallel count) --- diff --git a/bigscreen/fetch_max_score_for_player.cpp b/bigscreen/fetch_max_score_for_player.cpp index 70472b0..f63a582 100644 --- a/bigscreen/fetch_max_score_for_player.cpp +++ b/bigscreen/fetch_max_score_for_player.cpp @@ -7,8 +7,8 @@ void FetchMaxScoreForPlayer::operator() (pqxx::transaction<> &t) { pqxx::result res( t.exec("SELECT MAX(feetrating)*1000 AS max_score FROM songratings WHERE " "machine=( SELECT machine FROM tournaments WHERE tournament=" + pqxx::to_string(tournament) + ") AND " - "(song NOT IN ( SELECT song FROM scores WHERE tournament=" + pqxx::to_string(tournament) + " AND song IS NOT NULL AND ( " - "round=" + pqxx::to_string(round) + " OR parallel=0 OR ( player=" + pqxx::to_string(player) + " AND chosen='t' ) ) ) )") ); + "song NOT IN ( SELECT song FROM scores WHERE tournament=" + pqxx::to_string(tournament) + " AND song IS NOT NULL AND ( " + "parallel=0 OR ( player=" + pqxx::to_string(player) + " AND ( chosen='t' OR round=" + pqxx::to_string(round) + " ) ) ) )") ); *score = res.at(0)["max_score"].as(*score); }