From 9cb48c504ddb3882f39e2b17048f0593316a95ce Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Mon, 24 Aug 2026 21:10:41 -0700 Subject: bullet tweaks --- src/sim/lib/force.rs | 1 + src/sim/sim_manager/utils.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/sim') diff --git a/src/sim/lib/force.rs b/src/sim/lib/force.rs index c6cfaf0..d461589 100644 --- a/src/sim/lib/force.rs +++ b/src/sim/lib/force.rs @@ -98,6 +98,7 @@ pub fn apply_explosion( } // TODO profile packing entity ID into cells? +// TODO sink power in a radius around the impact // might improve performance by a lot if we don't have to raycast for hit entities pub fn apply_bullet(ctx: &mut SimCtx, from: Vec2, to: Vec2, power: u32) { let dda = AwDda::new(from, to); diff --git a/src/sim/sim_manager/utils.rs b/src/sim/sim_manager/utils.rs index 38f503a..75ef71d 100644 --- a/src/sim/sim_manager/utils.rs +++ b/src/sim/sim_manager/utils.rs @@ -145,7 +145,7 @@ pub fn read_back_entities_from_world( // first check if the entity has been partitioned let components = compute_components(&ec.cells, ec.size.x, ec.size.y); if components.len() == 0 { - panic!("The entity was completely destroyed?") + sim.destroy_entity(entity_id); } else if components.len() == 1 { // the entity's cells were changed, but not partitioned puffin::profile_scope!("Recompute collider"); -- cgit v1.3.1