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.
This commit is contained in:
evanpelle
2026-05-22 11:07:48 +01:00
parent 2ee2fb97e3
commit a2b3db616b
+5 -3
View File
@@ -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)))