fix(simulation): fix triangle state save/load and persist contamination
Three save/load bugs fixed: - ContaminationActive not persisted in SaveStateV1 — caused double-fire of contamination pressure on reload after tick 300. - Loaded triangle entities missing ActiveSim marker — made them invisible to escalation and contamination systems after any load. - Existing triangle entities not despawned before load — created duplicates, doubling tension escalation per tick. Also: HashSet → BTreeSet for D-010 compliance, defensive event queue reset on load, and three regression tests for triangle roundtrip. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -419,6 +419,7 @@ fn minimal_save() -> SaveStateV1 {
|
||||
triangle_states: vec![],
|
||||
open_doors: vec![],
|
||||
modifications: vec![],
|
||||
contamination_active: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -207,6 +207,7 @@ fn save_state_npc_kg_isolation() {
|
||||
triangle_states: vec![],
|
||||
open_doors: vec![],
|
||||
modifications: vec![],
|
||||
contamination_active: false,
|
||||
};
|
||||
|
||||
// Roundtrip: serialize → deserialize.
|
||||
|
||||
Reference in New Issue
Block a user