Skip to content

Commit d4ad5f2

Browse files
committed
Fix double counting points in live sim
1 parent 14d6eb2 commit d4ad5f2

File tree

1 file changed

+9
-10
lines changed
  • src/worker/core/GameSim.football

1 file changed

+9
-10
lines changed

src/worker/core/GameSim.football/index.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2412,21 +2412,20 @@ class GameSim extends GameSimBase {
24122412
this.team[t].stat[s] += signedAmount;
24132413
}
24142414

2415-
if (s === "pts") {
2416-
this.team[t].stat.ptsQtrs[qtr] += signedAmount;
2417-
this.playByPlay.logStat(t, undefined, "pts", signedAmount);
2418-
2419-
if (remove) {
2420-
this.playByPlay.removeLastScore();
2421-
}
2422-
}
2423-
24242415
if (p !== undefined && s !== "min") {
24252416
const logAmount = isLng ? p.stat[s] : signedAmount;
24262417
this.playByPlay.logStat(t, p.id, s, logAmount);
24272418
} else if (p === undefined) {
2428-
// Team penalties like delay of game, for the team penalty display at the top
2419+
// Team points, and also team penalties like delay of game, for the team penalty display at the top
24292420
this.playByPlay.logStat(t, undefined, s, signedAmount);
2421+
2422+
if (s === "pts") {
2423+
this.team[t].stat.ptsQtrs[qtr] += signedAmount;
2424+
2425+
if (remove) {
2426+
this.playByPlay.removeLastScore();
2427+
}
2428+
}
24302429
}
24312430
}
24322431
}

0 commit comments

Comments
 (0)