]> git.sesse.net Git - pkanalytics/commitdiff
Tweak formation backdating.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 29 May 2023 22:24:32 +0000 (00:24 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 29 May 2023 22:24:32 +0000 (00:24 +0200)
events.cpp

index 9826f0ecbbc487e8a23ec1932f4b4b52e0d66a39..cbdb30344e21e2c221b0ae7a7ca7cbba8e76dc08 100644 (file)
@@ -479,7 +479,7 @@ void EventsModel::set_team_at(uint64_t t, const set<int> &new_team)
 
 void EventsModel::set_formation_at(uint64_t t, bool offense, unsigned formation)
 {
-       // If there's another goal/stoppage no more than 20 seconds ago,
+       // If there's another goal/stoppage/turnover no more than 20 seconds ago,
        // we assume that the formation started at that point (it just took
        // the operator a bit of time to see it). If not, we assume we
        // changed in the middle of a point.
@@ -488,7 +488,14 @@ void EventsModel::set_formation_at(uint64_t t, bool offense, unsigned formation)
                if (e.t > t) {
                        break;
                }
-               if (e.type == "goal" || e.type == "their_goal" || e.type == "stoppage" || e.type == "reset" || e.type == "set_offense" || e.type == "set_defense" || e.type == "in" || e.type == "out" || e.type == "pull" || e.type == "their_pull") {
+               if (e.type == "goal" || e.type == "their_goal" ||
+                   e.type == "in" || e.type == "out" ||
+                   e.type == "stoppage" || e.type == "reset" ||
+                   e.type == "set_defense" || e.type == "set_offense" ||
+                   e.type == "throwaway" || e.type == "their_throwaway" ||
+                   e.type == "drop" || e.type == "defense" || e.type == "interception" ||
+                   e.type == "pull" || e.type == "pull_landed" || e.type == "pull_oob" || e.type == "their_pull" ||
+                   e.type == "formation_offense" || e.type == "formation_defense") {
                        backdate_point = e.t + 1;
                }
                if (e.type == "formation_offense" || e.type == "formation_defense") {