fix(simulation): resolve Bevy baseline test panics (#885)
Three root causes: SnapshotBuffer hard-dependency in economy.rs (Option-wrapped), TickPhase::configure missing from SimulationPlugin (added idempotent call), and stale golden file after D-192 dropped the version field (regenerated). All 6 previously-failing tests now pass with zero regressions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -299,13 +299,19 @@ pub struct EconQueryBuffer {
|
||||
pub fn serve_econ_state_query(
|
||||
mut query_buf: ResMut<EconQueryBuffer>,
|
||||
econ_state: Option<Res<EconStateResource>>,
|
||||
mut snapshot_buf: ResMut<SnapshotBuffer>,
|
||||
snapshot_buf: Option<ResMut<SnapshotBuffer>>,
|
||||
) {
|
||||
let system_id = match query_buf.pending.take() {
|
||||
Some(s) => s,
|
||||
None => return,
|
||||
};
|
||||
|
||||
// SnapshotBuffer only exists when BridgePlugin is loaded (not in standalone tests).
|
||||
let mut snapshot_buf = match snapshot_buf {
|
||||
Some(b) => b,
|
||||
None => return,
|
||||
};
|
||||
|
||||
let econ_state = match econ_state {
|
||||
Some(s) => s,
|
||||
None => {
|
||||
|
||||
@@ -24,6 +24,7 @@ pub mod modification;
|
||||
pub mod monologue;
|
||||
pub mod movement;
|
||||
pub mod movement_plugin;
|
||||
pub mod name_index;
|
||||
pub mod npc_components;
|
||||
pub mod npc_knowledge_transfer;
|
||||
pub mod path_follow;
|
||||
@@ -59,6 +60,10 @@ pub struct SimulationPlugin {
|
||||
|
||||
impl Plugin for SimulationPlugin {
|
||||
fn build(&self, app: &mut App) {
|
||||
// Phase ordering must be configured before any system is registered.
|
||||
// TickPhase::configure is idempotent — safe if main.rs calls it again.
|
||||
crate::tick_phases::TickPhase::configure(app);
|
||||
|
||||
// Tier marker components (D-026) — must register before behavior systems
|
||||
app.add_plugins(tier::TierPlugin);
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
"state_hash": 14452262397297540338,
|
||||
"tick": 8,
|
||||
"triangle_crisis_events": [],
|
||||
"version": 19,
|
||||
"visible_tiles": [
|
||||
{
|
||||
"tile_kind": "Floor",
|
||||
|
||||
Reference in New Issue
Block a user