diff --git a/crates/galactica/src/game.rs b/crates/galactica/src/game.rs index ece9f40..66af0df 100644 --- a/crates/galactica/src/game.rs +++ b/crates/galactica/src/game.rs @@ -48,12 +48,14 @@ impl<'a> Game { ); let s = self.state.systemsim.get_ship_mut(&player).unwrap(); - s.data - .add_outfit(&self.ct.get_outfit(OutfitHandle { index: 0 })); - s.data - .add_outfit(&self.ct.get_outfit(OutfitHandle { index: 1 })); - s.data - .add_outfit(&self.ct.get_outfit(OutfitHandle { index: 2 })); + s.add_outfits( + &self.ct, + [ + OutfitHandle { index: 0 }, + OutfitHandle { index: 1 }, + OutfitHandle { index: 2 }, + ], + ); return player; } @@ -70,9 +72,14 @@ impl<'a> Game { ); let s = systemsim.get_ship_mut(&a).unwrap(); - s.data.add_outfit(ct.get_outfit(OutfitHandle { index: 0 })); - s.data.add_outfit(&ct.get_outfit(OutfitHandle { index: 1 })); - s.data.add_outfit(&ct.get_outfit(OutfitHandle { index: 2 })); + s.add_outfits( + &ct, + [ + OutfitHandle { index: 0 }, + OutfitHandle { index: 1 }, + OutfitHandle { index: 2 }, + ], + ); let a = systemsim.add_ship( &ct, @@ -83,9 +90,14 @@ impl<'a> Game { ); let s = systemsim.get_ship_mut(&a).unwrap(); - s.data.add_outfit(ct.get_outfit(OutfitHandle { index: 0 })); - s.data.add_outfit(&ct.get_outfit(OutfitHandle { index: 1 })); - s.data.add_outfit(&ct.get_outfit(OutfitHandle { index: 2 })); + s.add_outfits( + &ct, + [ + OutfitHandle { index: 0 }, + OutfitHandle { index: 1 }, + OutfitHandle { index: 2 }, + ], + ); let state = GameState { systemsim, diff --git a/crates/galactica/src/main.rs b/crates/galactica/src/main.rs index 8b24857..0fbc79b 100644 --- a/crates/galactica/src/main.rs +++ b/crates/galactica/src/main.rs @@ -84,7 +84,7 @@ fn main() -> Result<()> { .systemsim .get_ship(&PhysSimShipHandle(player.ship.unwrap())); if let Some(o) = o { - match o.data.get_state() { + match o.get_data().get_state() { ShipState::Landing { .. } | ShipState::UnLanding { .. } | ShipState::Collapsing { .. } diff --git a/crates/system/src/phys/systemsim/step.rs b/crates/system/src/phys/systemsim/step.rs index 88676eb..ac8a466 100644 --- a/crates/system/src/phys/systemsim/step.rs +++ b/crates/system/src/phys/systemsim/step.rs @@ -243,6 +243,7 @@ impl PhysSim { self.projectiles.insert( collider.clone(), PhysProjectile::new( + res.ct, outfit.projectile.clone(), rigid_body, ship.data.get_faction(), @@ -290,7 +291,7 @@ impl PhysSim { // Delete projectiles let mut to_remove = Vec::new(); for (c, p) in &mut self.projectiles { - p.tick(res.t); + p.tick(res.ct, res.t); if p.is_expired() { to_remove.push(*c); }