fix(simulation): resolve Bevy schedule cycle — economy system ordering
tick_economy_simulation was ordered .after(advance_tick) which created a cycle: observer_snapshot → send_snapshot → advance_tick → tick_economy → observer_snapshot. Moved to .after(process_player_input) instead — the economy checks time.tick which works regardless of advance order. Also removed the .after(tick_economy_simulation) from handle_debug_commands that was added during Sprint 34 review — same cycle root cause. This is a symptom of #843 (ad-hoc ordering is fragile). Pair session scheduled to replace with system set phases. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -227,7 +227,10 @@ impl Plugin for BridgePlugin {
|
||||
receive_bridge_inputs.before(crate::simulation::input::process_player_input),
|
||||
debug::handle_debug_commands
|
||||
.after(crate::simulation::input::process_player_input)
|
||||
.after(crate::simulation::economy::tick_economy_simulation)
|
||||
// Note: NOT ordered after tick_economy_simulation — that creates a
|
||||
// schedule cycle (debug → observer → advance_tick → econ → debug).
|
||||
// GetEconState reads from EconStateResource which may be one tick
|
||||
// stale on economy-tick boundaries. Acceptable for debug tooling.
|
||||
.before(crate::perception::observer::compute_observer_snapshot),
|
||||
crate::perception::observer::compute_visibility_geometry
|
||||
.after(crate::simulation::movement::validate_movement),
|
||||
|
||||
Reference in New Issue
Block a user