debug: log evolutionTree state to diagnose empty nodes
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 22s
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 22s
This commit is contained in:
@@ -44,7 +44,13 @@
|
|||||||
let activeBranch = $state<Branch>('ponte');
|
let activeBranch = $state<Branch>('ponte');
|
||||||
|
|
||||||
let branchConfig = $derived(BRANCH_CONFIG[activeBranch]);
|
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 spentDna = $derived(getSpentDna(game.state.evolutionTree));
|
||||||
let hasUnlocked = $derived(spentDna > 0);
|
let hasUnlocked = $derived(spentDna > 0);
|
||||||
let resetCost = $derived(getTreeResetCost(game.state));
|
let resetCost = $derived(getTreeResetCost(game.state));
|
||||||
|
|||||||
Reference in New Issue
Block a user