fix(simulation): correct CONTAMINATION_DELAY_TICKS from 1800 to 300

The constant was supposed to represent 30 game-minutes but the formula
was wrong (30 × 10 tps × 60s = 1800). Correct derivation: 30 minutes ×
TICKS_PER_GAME_MINUTE (10) = 300. Now uses the canonical constant
directly. Also fixes stale assertion message in integration test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 23:24:47 +01:00
co-authored by Claude Opus 4.6
parent d867cf1e3b
commit 70de959ac3
2 changed files with 13 additions and 12 deletions
+7 -6
View File
@@ -42,10 +42,10 @@ fn make_triangle(
}
}
/// Acceptance test: run 1801 ticks, assert ContaminationActive is set and
/// all ActiveFork TriangleState entities have tension > 0.
/// Acceptance test: run past CONTAMINATION_DELAY_TICKS, assert ContaminationActive
/// is set and all ActiveFork TriangleState entities have tension > 0.
#[test]
fn contamination_activates_after_1801_ticks() {
fn contamination_activates_after_delay() {
let mut world = World::new();
world.init_resource::<SimulationTime>();
world.init_resource::<ContaminationActive>();
@@ -102,8 +102,8 @@ fn contamination_activates_after_1801_ticks() {
let mut schedule = Schedule::default();
schedule.add_systems(tick_contamination_activation);
// Simulate 1801 ticks
for tick in 0..=1800 {
// Simulate past the delay threshold (CONTAMINATION_DELAY_TICKS = 300)
for tick in 0..=CONTAMINATION_DELAY_TICKS {
world.resource_mut::<SimulationTime>().tick = tick;
schedule.run(&mut world);
}
@@ -111,7 +111,8 @@ fn contamination_activates_after_1801_ticks() {
// Assert ContaminationActive is set
assert!(
world.resource::<ContaminationActive>().0,
"ContaminationActive must be true after 1801 ticks"
"ContaminationActive must be true after CONTAMINATION_DELAY_TICKS ({}) ticks",
CONTAMINATION_DELAY_TICKS
);
// Assert all ActiveFork triangles have tension > 0