From d36d9d61a88480a0dffaca319666724670d21b60 Mon Sep 17 00:00:00 2001 From: josh Date: Fri, 24 Apr 2026 22:22:42 -0400 Subject: [PATCH] Fix DC uptime always showing 100% despite rack failures Failed racks were removed from dc.racks in Phase 3 before uptime was calculated in Phase 4, so healthyCount always equaled totalInDc. Now counts racks in the repair pipeline as down capacity. Co-Authored-By: Claude Opus 4.6 --- packages/game-engine/src/systems/infrastructureSystem.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/game-engine/src/systems/infrastructureSystem.ts b/packages/game-engine/src/systems/infrastructureSystem.ts index f2d61bd..50ef3b8 100644 --- a/packages/game-engine/src/systems/infrastructureSystem.ts +++ b/packages/game-engine/src/systems/infrastructureSystem.ts @@ -238,8 +238,9 @@ export function processInfrastructure(state: GameState): InfraTickResult { let dcFlops = 0; let usedPowerKW = 0; + const repairingForDc = rackPipeline.filter(o => o.dataCenterId === dc.id && o.stage === 'repair').length; const healthyCount = dc.racks.length; - const totalInDc = dc.racks.length; + const totalInDc = dc.racks.length + repairingForDc; for (const rack of dc.racks) { const sku = RACK_SKU_CONFIGS[rack.skuId];