From 6fcf3b4e085ab8009ff1b0fd34e3f0ff8765465b Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Thu, 27 Aug 2026 00:26:35 -0700 Subject: chair, performance improvement --- src/sim/sim_manager/utils.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/sim/sim_manager/utils.rs') diff --git a/src/sim/sim_manager/utils.rs b/src/sim/sim_manager/utils.rs index 75ef71d..d744ec0 100644 --- a/src/sim/sim_manager/utils.rs +++ b/src/sim/sim_manager/utils.rs @@ -117,7 +117,7 @@ pub fn read_back_entities_from_world( for (lx, ly, x, y) in cells_written { // update the entity // TODO optimize - let new_local_cell = sim.cell_manager.get_cell_from_game_position(x, y).unwrap(); + let mut new_local_cell = sim.cell_manager.get_cell_from_game_position(x, y).unwrap(); if !new_local_cell.entity_integrated() { // this means that the entity changed in some way, so we should recompute its shape // TODO wait N frames to debounce this @@ -127,6 +127,7 @@ pub fn read_back_entities_from_world( let entity_cells = entity.data.cells.as_mut().unwrap(); // we do this unconditionally because it's cheaper than checking if it actually needs to be updated // and because we don't have a good way to track changes to cell state + new_local_cell.set_entity_integrated(true); entity_cells .set_cell_at_local_position(IVec2::new(lx as i32, ly as i32), new_local_cell); } -- cgit v1.3.1