Minor fixes
parent
d5f0cbd678
commit
fa992d3fb5
|
@ -46,7 +46,7 @@ impl Ship {
|
|||
pub fn fire_guns(&mut self) -> Vec<(Projectile, content::GunPoint)> {
|
||||
self.outfits
|
||||
.iter_guns_points()
|
||||
.filter(|(g, _)| g.cooldown > 0.0)
|
||||
.filter(|(g, _)| g.cooldown <= 0.0)
|
||||
.map(|(g, p)| {
|
||||
let mut rng = rand::thread_rng();
|
||||
g.cooldown = g.kind.rate + &rng.gen_range(-g.kind.rate_rng..=g.kind.rate_rng);
|
||||
|
|
|
@ -35,10 +35,12 @@ impl ShipBehavior for Point {
|
|||
// Iterate all possible targets
|
||||
let mut it = physics
|
||||
.iter_ship_body()
|
||||
.filter(|(s, _)| match my_faction.relationships[&s.ship.faction] {
|
||||
.filter(
|
||||
|(s, _)| match my_faction.relationships.get(&s.ship.faction).unwrap() {
|
||||
content::Relationship::Hostile => true,
|
||||
_ => false,
|
||||
})
|
||||
},
|
||||
)
|
||||
.map(|(_, r)| r);
|
||||
|
||||
// Find the closest target
|
||||
|
|
|
@ -116,7 +116,7 @@ impl Game {
|
|||
let s = object::Ship::new(
|
||||
&ct,
|
||||
content::ShipHandle { index: 0 },
|
||||
content::FactionHandle { index: 0 },
|
||||
content::FactionHandle { index: 1 },
|
||||
o1,
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue