Minor edits
parent
fdd481e8f0
commit
f7525901f5
|
@ -48,12 +48,14 @@ impl<'a> Game {
|
||||||
);
|
);
|
||||||
|
|
||||||
let s = self.state.systemsim.get_ship_mut(&player).unwrap();
|
let s = self.state.systemsim.get_ship_mut(&player).unwrap();
|
||||||
s.data
|
s.add_outfits(
|
||||||
.add_outfit(&self.ct.get_outfit(OutfitHandle { index: 0 }));
|
&self.ct,
|
||||||
s.data
|
[
|
||||||
.add_outfit(&self.ct.get_outfit(OutfitHandle { index: 1 }));
|
OutfitHandle { index: 0 },
|
||||||
s.data
|
OutfitHandle { index: 1 },
|
||||||
.add_outfit(&self.ct.get_outfit(OutfitHandle { index: 2 }));
|
OutfitHandle { index: 2 },
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
return player;
|
return player;
|
||||||
}
|
}
|
||||||
|
@ -70,9 +72,14 @@ impl<'a> Game {
|
||||||
);
|
);
|
||||||
|
|
||||||
let s = systemsim.get_ship_mut(&a).unwrap();
|
let s = systemsim.get_ship_mut(&a).unwrap();
|
||||||
s.data.add_outfit(ct.get_outfit(OutfitHandle { index: 0 }));
|
s.add_outfits(
|
||||||
s.data.add_outfit(&ct.get_outfit(OutfitHandle { index: 1 }));
|
&ct,
|
||||||
s.data.add_outfit(&ct.get_outfit(OutfitHandle { index: 2 }));
|
[
|
||||||
|
OutfitHandle { index: 0 },
|
||||||
|
OutfitHandle { index: 1 },
|
||||||
|
OutfitHandle { index: 2 },
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
let a = systemsim.add_ship(
|
let a = systemsim.add_ship(
|
||||||
&ct,
|
&ct,
|
||||||
|
@ -83,9 +90,14 @@ impl<'a> Game {
|
||||||
);
|
);
|
||||||
|
|
||||||
let s = systemsim.get_ship_mut(&a).unwrap();
|
let s = systemsim.get_ship_mut(&a).unwrap();
|
||||||
s.data.add_outfit(ct.get_outfit(OutfitHandle { index: 0 }));
|
s.add_outfits(
|
||||||
s.data.add_outfit(&ct.get_outfit(OutfitHandle { index: 1 }));
|
&ct,
|
||||||
s.data.add_outfit(&ct.get_outfit(OutfitHandle { index: 2 }));
|
[
|
||||||
|
OutfitHandle { index: 0 },
|
||||||
|
OutfitHandle { index: 1 },
|
||||||
|
OutfitHandle { index: 2 },
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
let state = GameState {
|
let state = GameState {
|
||||||
systemsim,
|
systemsim,
|
||||||
|
|
|
@ -84,7 +84,7 @@ fn main() -> Result<()> {
|
||||||
.systemsim
|
.systemsim
|
||||||
.get_ship(&PhysSimShipHandle(player.ship.unwrap()));
|
.get_ship(&PhysSimShipHandle(player.ship.unwrap()));
|
||||||
if let Some(o) = o {
|
if let Some(o) = o {
|
||||||
match o.data.get_state() {
|
match o.get_data().get_state() {
|
||||||
ShipState::Landing { .. }
|
ShipState::Landing { .. }
|
||||||
| ShipState::UnLanding { .. }
|
| ShipState::UnLanding { .. }
|
||||||
| ShipState::Collapsing { .. }
|
| ShipState::Collapsing { .. }
|
||||||
|
|
|
@ -243,6 +243,7 @@ impl PhysSim {
|
||||||
self.projectiles.insert(
|
self.projectiles.insert(
|
||||||
collider.clone(),
|
collider.clone(),
|
||||||
PhysProjectile::new(
|
PhysProjectile::new(
|
||||||
|
res.ct,
|
||||||
outfit.projectile.clone(),
|
outfit.projectile.clone(),
|
||||||
rigid_body,
|
rigid_body,
|
||||||
ship.data.get_faction(),
|
ship.data.get_faction(),
|
||||||
|
@ -290,7 +291,7 @@ impl PhysSim {
|
||||||
// Delete projectiles
|
// Delete projectiles
|
||||||
let mut to_remove = Vec::new();
|
let mut to_remove = Vec::new();
|
||||||
for (c, p) in &mut self.projectiles {
|
for (c, p) in &mut self.projectiles {
|
||||||
p.tick(res.t);
|
p.tick(res.ct, res.t);
|
||||||
if p.is_expired() {
|
if p.is_expired() {
|
||||||
to_remove.push(*c);
|
to_remove.push(*c);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue