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