mirror of
https://github.com/doukutsu-rs/doukutsu-rs
synced 2024-11-26 15:23:38 +00:00
bullet lifetime fix
This commit is contained in:
parent
82511ca6b7
commit
9a7ea5be42
|
@ -25,6 +25,11 @@ impl BulletManager {
|
|||
|
||||
pub fn tick_bullets(&mut self, state: &mut SharedGameState, player: &dyn PhysicalEntity, stage: &mut Stage) {
|
||||
for bullet in self.bullets.iter_mut() {
|
||||
if bullet.life < 1 {
|
||||
bullet.cond.set_alive(false);
|
||||
continue;
|
||||
}
|
||||
|
||||
bullet.tick(state, player);
|
||||
bullet.hit_flags.0 = 0;
|
||||
bullet.tick_map_collisions(state, stage);
|
||||
|
|
|
@ -637,7 +637,9 @@ impl GameScene {
|
|||
// todo show damage
|
||||
}
|
||||
}
|
||||
} else if !bullet.flags.hit_right_slope() {
|
||||
} else if !bullet.flags.hit_right_slope()
|
||||
&& bullet.btype != 13 && bullet.btype != 14 && bullet.btype != 15
|
||||
&& bullet.btype != 28 && bullet.btype != 29 && bullet.btype != 30 {
|
||||
state.create_caret((bullet.x + npc.x) / 2, (bullet.y + npc.y) / 2, CaretType::ProjectileDissipation, Direction::Right);
|
||||
// todo play sound 31
|
||||
bullet.life = 0;
|
||||
|
|
Loading…
Reference in a new issue