From a2b3db616b83dfddf98e6cd50c1bec6fb1aec15e Mon Sep 17 00:00:00 2001 From: evanpelle Date: Fri, 22 May 2026 11:07:48 +0100 Subject: [PATCH] WebGL: re-upload structures when owner changes (capture) The structure dirty flag missed ownership changes, so captured buildings kept rendering in the previous owner's color until another structure event (level/active/construction) forced a re-upload. --- src/client/view/GameView.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/view/GameView.ts b/src/client/view/GameView.ts index 2b35a4a8c..9db7f6052 100644 --- a/src/client/view/GameView.ts +++ b/src/client/view/GameView.ts @@ -373,11 +373,13 @@ export class GameView implements GameMap { let unit = this._units.get(update.id); const isStructure = STRUCTURE_TYPES.has(update.unitType); if (unit !== undefined) { - // Structure changes that affect rendering: level changed, became - // inactive, or finished construction (underConstruction → !underConstruction). + // Structure changes that affect rendering: owner changed (captured), + // level changed, became inactive, or finished construction + // (underConstruction → !underConstruction). if ( isStructure && - (unit.state.level !== update.level || + (unit.state.ownerID !== update.ownerID || + unit.state.level !== update.level || unit.state.isActive !== update.isActive || (unit.state.underConstruction && !(update.underConstruction ?? false)))