debug: log evolutionTree state to diagnose empty nodes
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 22s

This commit is contained in:
2026-03-28 20:42:31 +01:00
parent 67931eeadb
commit 1488962537

View File

@@ -44,7 +44,13 @@
let activeBranch = $state<Branch>('ponte');
let branchConfig = $derived(BRANCH_CONFIG[activeBranch]);
let branchNodes = $derived(game.state.evolutionTree.filter((n) => n.branch === activeBranch));
let branchNodes = $derived(game.state.evolutionTree.filter((n: any) => n.branch === activeBranch));
// Debug — remove after fix confirmed
$effect(() => {
const tree = game.state.evolutionTree;
console.log('[EvolutionTree] tree length:', tree.length, 'activeBranch:', activeBranch, 'filtered:', tree.filter((n: any) => n.branch === activeBranch).length, 'first node:', tree[0] ? { id: tree[0].id, branch: tree[0].branch } : 'empty');
});
let spentDna = $derived(getSpentDna(game.state.evolutionTree));
let hasUnlocked = $derived(spentDna > 0);
let resetCost = $derived(getTreeResetCost(game.state));