Skip to content

fix: battle simulator spawn button works with workers#1342

Merged
braedonsaunders merged 1 commit into
mainfrom
claude/fix-spawn-button-gCT1p
Feb 4, 2026
Merged

fix: battle simulator spawn button works with workers#1342
braedonsaunders merged 1 commit into
mainfrom
claude/fix-spawn-button-gCT1p

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner

The spawn button wasn't working because events weren't crossing the worker boundary. BattleSimulatorPanel emitted unit:spawn on the main thread's Game.eventBus, but SpawnSystem listens on the worker's eventBus.

Changes:

  • Add spawnUnit and destroyEntity message types to worker protocol
  • Handle these messages in GameWorker to emit events in worker
  • Add spawnUnit() and destroyEntity() methods to WorkerBridge
  • Update BattleSimulatorPanel to use WorkerBridge for spawning
  • Add entity:destroy event handler in SpawnSystem for cleanup

https://claude.ai/code/session_01UJqyFjoUhAyMCm2VT79Jff

The spawn button wasn't working because events weren't crossing
the worker boundary. BattleSimulatorPanel emitted unit:spawn on
the main thread's Game.eventBus, but SpawnSystem listens on the
worker's eventBus.

Changes:
- Add spawnUnit and destroyEntity message types to worker protocol
- Handle these messages in GameWorker to emit events in worker
- Add spawnUnit() and destroyEntity() methods to WorkerBridge
- Update BattleSimulatorPanel to use WorkerBridge for spawning
- Add entity:destroy event handler in SpawnSystem for cleanup

https://claude.ai/code/session_01UJqyFjoUhAyMCm2VT79Jff
@braedonsaunders braedonsaunders merged commit 8d32af1 into main Feb 4, 2026
1 of 4 checks passed
@braedonsaunders braedonsaunders deleted the claude/fix-spawn-button-gCT1p branch February 4, 2026 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants