small fix

This commit is contained in:
2025-04-06 16:27:12 +02:00
parent e49373061e
commit 054e58e1af

View File

@@ -143,7 +143,9 @@ fn shot_collision(
let shot_entity = if query_shot.contains(*e1) { *e1 } else { *e2 }; let shot_entity = if query_shot.contains(*e1) { *e1 } else { *e2 };
let shot_pos = query_shot.get(shot_entity).unwrap().1.translation; let Ok(shot_pos) = query_shot.get(shot_entity).map(|(_, t)| t.translation) else {
continue;
};
commands.entity(shot_entity).despawn_recursive(); commands.entity(shot_entity).despawn_recursive();