1
0
Fork 0
mirror of https://github.com/doukutsu-rs/doukutsu-rs synced 2025-11-30 08:08:18 +00:00

fix bullets breaking multiple snack blocks in a single hit

This commit is contained in:
Alula 2020-11-02 11:54:17 +01:00
parent c92224dc96
commit 6964b8d167
No known key found for this signature in database
GPG key ID: 3E00485503A1D8BA

View file

@ -572,7 +572,7 @@ impl PhysicalEntity for Bullet {
}
for (idx, (&ox, &oy)) in OFF_X.iter().zip(OFF_Y.iter()).enumerate() {
if idx == 4 {
if idx == 4 || !self.cond.alive() {
break;
}
@ -595,13 +595,13 @@ impl PhysicalEntity for Bullet {
state.create_caret(self.x, self.y, CaretType::ProjectileDissipation, Direction::Left);
state.sound_manager.play_sfx(12);
for _ in 0..4 {
let mut npc = NPCMap::create_npc(4, &state.npc_table);
let mut npc = NPCMap::create_npc(4, &state.npc_table);
npc.cond.set_alive(true);
npc.direction = Direction::Left;
npc.x = x * 16 * 0x200;
npc.y = y * 16 * 0x200;
npc.cond.set_alive(true);
npc.direction = Direction::Left;
npc.x = x * 16 * 0x200;
npc.y = y * 16 * 0x200;
for _ in 0..4 {
npc.vel_x = state.game_rng.range(-0x200..0x200) as isize;
npc.vel_y = state.game_rng.range(-0x200..0x200) as isize;