From 4aeece4aefa495e6bb5c6bb885c0577715ff6079 Mon Sep 17 00:00:00 2001 From: Giovanni <58086174+Automatron76@users.noreply.github.com> Date: Mon, 27 Apr 2026 15:49:08 +0100 Subject: [PATCH] fix: render spawn highlight on 1/5 frames instead of 4/5 (#3782) Resolves #3590 ## Description: The spawnHighlight() function in TerritoryLayer.ts was using `=== 0` as the condition to return early, which caused the spawn highlight to render on 4 out of every 5 frames instead of the intended 1 out of 5. Changed `=== 0` to `!== 0` so the function skips rendering on 4/5 frames, improving performance especially on large maps. ## Please complete the following: - [ ] I have added screenshots for all UI updates - [ ] 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 --- src/client/graphics/layers/TerritoryLayer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/graphics/layers/TerritoryLayer.ts b/src/client/graphics/layers/TerritoryLayer.ts index a999380e1..60156f9aa 100644 --- a/src/client/graphics/layers/TerritoryLayer.ts +++ b/src/client/graphics/layers/TerritoryLayer.ts @@ -167,7 +167,7 @@ export class TerritoryLayer implements Layer { } private spawnHighlight() { - if (this.game.ticks() % 5 === 0) { + if (this.game.ticks() % 5 !== 0) { return; }