fix: deduplicate click power formula via getClickPower()
Some checks failed
Accessibility Checks / a11y-audit (pull_request) Failing after 2s
Smoke Test / smoke (pull_request) Failing after 4s

Inline formula at Swarm Protocol calc replaced with canonical
getClickPower() call, satisfying guardrail rule 2 (single source
of truth for click power formula).
This commit is contained in:
Alexander Whitestone
2026-04-12 11:55:37 -04:00
parent eb2579f1fa
commit eb5d1ae9d9

View File

@@ -1146,8 +1146,7 @@ function updateRates() {
// Swarm Protocol: buildings auto-code based on click power
if (G.swarmFlag === 1) {
const totalBuildings = Object.values(G.buildings).reduce((a, b) => a + b, 0);
// Compute click power using snapshot boost to avoid debuff mutation
const _clickPower = (1 + Math.floor(G.buildings.autocoder * 0.5) + Math.max(0, (G.phase - 1)) * 2) * _codeBoost;
const _clickPower = getClickPower();
G.swarmRate = totalBuildings * _clickPower;
G.codeRate += G.swarmRate;
}