Fix innacuracy [ci skip]

This commit is contained in:
biroder 2023-04-26 12:07:20 +03:00
parent 0e164a44df
commit 40767c021b
2 changed files with 15 additions and 5 deletions

View File

@ -188,14 +188,19 @@ impl NPC {
Ok(())
}
pub(crate) fn tick_n016_save_point(&mut self, state: &mut SharedGameState) -> GameResult {
pub(crate) fn tick_n016_save_point(&mut self, state: &mut SharedGameState, npc_list: &NPCList) -> GameResult {
if self.action_num == 0 {
self.action_num = 1;
if self.direction == Direction::Right {
self.npc_flags.set_interactable(false);
self.vel_y = -0x200;
}
//Creates smoke when spawned in a shelter
if state.get_flag(523) {
npc_list.create_death_smoke(self.x, self.y, self.display_bounds.right as usize, 3, state, &self.rng);
}
}
if self.flags.hit_bottom_wall() {
@ -214,9 +219,14 @@ impl NPC {
Ok(())
}
pub(crate) fn tick_n017_health_refill(&mut self, state: &mut SharedGameState) -> GameResult {
pub(crate) fn tick_n017_health_refill(&mut self, state: &mut SharedGameState, npc_list: &NPCList) -> GameResult {
if self.action_num == 0 {
self.action_num = 1;
//Creates smoke when spawned in a shelter
if state.get_flag(523) {
npc_list.create_death_smoke(self.x, self.y, self.display_bounds.right as usize, 3, state, &self.rng);
}
}
match self.action_num {

View File

@ -267,8 +267,8 @@ impl GameEntity<([&mut Player; 2], &NPCList, &mut Stage, &mut BulletManager, &mu
13 => self.tick_n013_forcefield(state),
14 => self.tick_n014_key(state),
15 => self.tick_n015_chest_closed(state, npc_list),
16 => self.tick_n016_save_point(state),
17 => self.tick_n017_health_refill(state),
16 => self.tick_n016_save_point(state, npc_list),
17 => self.tick_n017_health_refill(state, npc_list),
18 => self.tick_n018_door(state, npc_list),
19 => self.tick_n019_balrog_bust_in(state, npc_list),
20 => self.tick_n020_computer(state),