Skip to content

chore: remove dead pre-v10 nurse teleport branch in tickNurseActions #155

@LightAxe

Description

@LightAxe

Location

src/sim/ant/ant-system.ts line 858

Description

tickNurseActions sets const v10 = true unconditionally and wraps the entire V10+ nurse state machine in if (v10) { ... } else { // Pre-v10 path (legacy teleport) }. The else branch (~line 1025 onward) is permanently unreachable dead code — v10 is a boolean literal, not derived from world.simVersion.

This was the pre-V10 teleport-based nursing model. It became dead when the V10 visible-brood-carry path was made permanent, and was left in place as a const v10 = true flag rather than being deleted. D2 removed all other version-gated legacy paths; this one was missed.

Impact

No runtime impact — the V10 path executes correctly for all V22+ worlds (the only loadable worlds post-D2). The dead else block is misleading: it looks like a viable fallback path and creates confusion about what tickNurseActions actually does. It also silently carries dead comments referencing pre-v10 invariants throughout the function.

Fix

  • Remove const v10 = true (line 858)
  • Remove the if (v10) { wrapper (line 866) — keep the inner body as the unconditional path
  • Delete the } else { branch from line ~1025 to its closing brace
  • Update any inline comments that reference "v10+" as a conditional qualifier to remove the qualifier (they describe current always-on behavior)

Severity

Low — cleanup / dead code. No behaviour change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions