From 730d4924751cd355b090e4e67682ed215150ab39 Mon Sep 17 00:00:00 2001 From: VariableVince <24507472+VariableVince@users.noreply.github.com> Date: Sat, 11 Oct 2025 22:40:07 +0200 Subject: [PATCH] Fix owned % in Teams stats (#2176) ## Description: In Teams games, the Leaderboard for individual players shows a different Owned % than the Team stats next to it. This is because Leaderboard correctly takes fallout/nuked territory into account (lines 99 and 113). But Team stats doesn't. It's only visual because the win condition for 95% of the land is also already calculated correctly in WinCheckCondition (lines 78-80). There is still a difference where Leaderbord uses toFixed(1) and TeamStats does toPrecision(2). Didn't touch that because i don't know the reason for it. BEFORE: Team stats owned not taking fallout
into consideration AFTER: image ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [ ] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: tryout33 --- src/client/graphics/layers/TeamStats.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/graphics/layers/TeamStats.ts b/src/client/graphics/layers/TeamStats.ts index e22ce57f7..ba8e9dbe7 100644 --- a/src/client/graphics/layers/TeamStats.ts +++ b/src/client/graphics/layers/TeamStats.ts @@ -83,7 +83,9 @@ export class TeamStats extends LitElement implements Layer { } } - const totalScorePercent = totalScoreSort / this.game.numLandTiles(); + const numTilesWithoutFallout = + this.game.numLandTiles() - this.game.numTilesWithFallout(); + const totalScorePercent = totalScoreSort / numTilesWithoutFallout; return { teamName: teamStr,