Merge pull request 'fix: clamp negative resources + add tutorial focus trap' (#220) from sprint/issue-resource-clamp-focus-trap into main
Some checks failed
Smoke Test / smoke (push) Has been cancelled

This commit was merged in pull request #220.
This commit is contained in:
2026-04-21 15:24:34 +00:00
2 changed files with 25 additions and 0 deletions

View File

@@ -142,6 +142,11 @@ function tick() {
G.harmony += G.harmonyRate * dt;
G.harmony = Math.max(0, Math.min(100, G.harmony));
// Clamp resources to prevent negative values from debuffs/Fenrir drain
G.ops = Math.max(0, G.ops);
G.trust = Math.max(0, G.trust);
G.compute = Math.max(0, G.compute);
// Track totals
G.totalCode += G.codeRate * dt;
G.totalCompute += G.computeRate * dt;