Minor edits

master
Mark 2024-01-20 10:04:31 -08:00
parent fdd481e8f0
commit f7525901f5
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
3 changed files with 27 additions and 14 deletions

View File

@ -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,

View File

@ -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 { .. }

View File

@ -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);
}