BUGFIX: fix exploit where favor limit from IPvGO was removed on augmentation (#2050)

* IPVGO: fix exploit where favor cap was reset on augmentation

* IPVGO: fix exploit where favor cap was reset on augmentation

* IPVGO: linting

* IPvGO: only reset No AI with ResetStats unless specified otherwise
This commit is contained in:
Michael Ficocelli
2025-03-31 16:30:55 -04:00
committed by GitHub
parent 5dc80587a7
commit 5d486e3914

View File

@@ -5,7 +5,6 @@ import { getRecordKeys, PartialRecord } from "../Types/Record";
import { resetGoPromises } from "./boardAnalysis/goAI";
import { getNewBoardState } from "./boardState/boardState";
import { EventEmitter } from "../utils/EventEmitter";
import { newOpponentStats } from "./Constants";
export class GoObject {
// Todo: Make previous game a slimmer interface
@@ -16,7 +15,17 @@ export class GoObject {
prestigeAugmentation() {
for (const opponent of getRecordKeys(Go.stats)) {
Go.stats[opponent] = newOpponentStats();
const stats = Go.stats[opponent];
if (!stats) {
continue;
}
stats.wins = 0;
stats.losses = 0;
stats.nodes = 0;
stats.nodePower = 0;
stats.winStreak = 0;
stats.oldWinStreak = 0;
stats.highestWinStreak = 0;
}
}
prestigeSourceFile() {