From d59a3bb62325da302380dd0eeb9c8af21d9ee566 Mon Sep 17 00:00:00 2001 From: PilkeySEK <156579268+PilkeySEK@users.noreply.github.com> Date: Sun, 30 Mar 2025 18:13:41 +0200 Subject: [PATCH] fix: Make bot team not able to win (#375) ## Please complete the following: - [X] I have added screenshots for all UI updates - [X] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [X] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: PilkeySEK Bot team has over 80% of the map: ![image](https://github.com/user-attachments/assets/a3f3e18b-e23e-4645-89a6-fd876ec73ff7) How it was before (the bug): ![image](https://github.com/user-attachments/assets/ff872d2d-a9a9-4f3f-96ff-3153d3bff333) --- src/core/execution/WinCheckExecution.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/execution/WinCheckExecution.ts b/src/core/execution/WinCheckExecution.ts index edf5a1e5d..12619bdb6 100644 --- a/src/core/execution/WinCheckExecution.ts +++ b/src/core/execution/WinCheckExecution.ts @@ -1,5 +1,12 @@ import { EventBus, GameEvent } from "../EventBus"; -import { Execution, Game, GameMode, Player, Team } from "../game/Game"; +import { + Execution, + Game, + GameMode, + Player, + Team, + TeamName, +} from "../game/Game"; export class WinEvent implements GameEvent { constructor(public readonly winner: Player) {} @@ -66,6 +73,7 @@ export class WinCheckExecution implements Execution { this.mg.numLandTiles() - this.mg.numTilesWithFallout(); const percentage = (max[1] / numTilesWithoutFallout) * 100; if (percentage > this.mg.config().percentageTilesOwnedToWin()) { + if (max[0].name == TeamName.Bot) return; this.mg.setWinner(max[0].name, this.mg.stats().stats()); console.log(`${max[0].name} has won the game`); this.active = false;