From b6340f9663c6b10952abb4b1782d067aaa8e00e9 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Fri, 27 Feb 2026 17:59:38 +0100 Subject: [PATCH] fix(simulation): clean up warnings in spawn and template modules (#166) Remove duplicate #[test] attribute, unused TemplateId import, and dead spawn_escalation_npc helper function (no longer referenced after #250 refactor). Co-Authored-By: Claude Opus 4.6 --- server/src/content/spawn.rs | 5 ++--- server/src/content/template.rs | 28 ---------------------------- 2 files changed, 2 insertions(+), 31 deletions(-) diff --git a/server/src/content/spawn.rs b/server/src/content/spawn.rs index 3368111f6..f8bc2042e 100644 --- a/server/src/content/spawn.rs +++ b/server/src/content/spawn.rs @@ -1263,7 +1263,6 @@ mod tests { assert_eq!(edge.trust, 7); } - #[test] #[test] fn spawn_npc_combat_trained_sets_skill_flag() { // #91: combat_trained: true in YAML sets SkillSet.combat_trained = true. @@ -1343,8 +1342,8 @@ mod tests { fn minimal_template_def_4_roles() -> crate::content::template::FullTemplateDef { use crate::content::template::{ ConflictType, CrossTemplateLinkSpec, FullTemplateDef, NpcAxis, PrivacyLevel, - RelationshipConstraint, RoleId, RoleSchema, SpaceSpec, TemplateId, TrafficPattern, - TriangleDef, TriangleId, TrustRange, + RelationshipConstraint, RoleId, RoleSchema, SpaceSpec, TrafficPattern, TriangleDef, + TriangleId, TrustRange, }; use crate::npc::{RelationshipKind, Skill}; diff --git a/server/src/content/template.rs b/server/src/content/template.rs index 55e844d34..1183886c6 100644 --- a/server/src/content/template.rs +++ b/server/src/content/template.rs @@ -1564,7 +1564,6 @@ mod tests { // #250 — Triangle escalation system tests // ----------------------------------------------------------------------- - use crate::npc::Npc; use crate::simulation::time::SimulationTime; use bevy_ecs::schedule::Schedule; @@ -1577,33 +1576,6 @@ mod tests { world } - /// Helper: spawn an NPC with a known StableId and ToleranceThreshold, - /// and register it in the EntityRegistry. - fn spawn_escalation_npc( - world: &mut bevy_ecs::world::World, - stable_id: u64, - threshold: i16, - ) -> bevy_ecs::entity::Entity { - let sid = StableId(stable_id); - let entity = world - .spawn(( - Npc, - ActiveSim, - StableEntityId(sid), - ToleranceThreshold { - current_stress: 0, - threshold, - }, - )) - .id(); - - world - .resource_mut::() - .register_existing(entity, sid); - - entity - } - // escalation_simmering_to_active, resolve, dormant_skip, resolved_skip, // game-minute-only, active-sim-only, saturation, resolve-targeting — all // covered by integration tests in tests/triangle_escalation.rs.