Minor fix

master
Mark 2024-01-01 16:51:34 -08:00
parent a75ca14ead
commit 53446bf5d2
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
1 changed files with 7 additions and 5 deletions

View File

@ -107,7 +107,7 @@ impl<'a> World {
self.projectiles.insert(
collider.clone(),
ProjectileWorldObject {
projectile: projectile,
projectile,
rigid_body,
collider,
},
@ -186,10 +186,12 @@ impl<'a> World {
projectiles.push((s.physics_handle, s.ship.fire_guns()));
}
}
let _ = projectiles
.into_iter()
.map(|(s, p)| self.add_projectiles(&s, p));
let _ = to_remove.into_iter().map(|s| self.remove_ship(s));
for (s, p) in projectiles {
self.add_projectiles(&s, p);
}
for s in to_remove {
self.remove_ship(s);
}
// Update physics
self.wrapper.step(t, &self.collision_handler);