Maybe this implementation would be better

This commit is contained in:
biroder 2023-03-05 09:18:02 +02:00 committed by alula
parent f91e793062
commit 8992889e94
1 changed files with 7 additions and 7 deletions

View File

@ -939,13 +939,13 @@ impl Player {
impl GameEntity<&NPCList> for Player {
fn tick(&mut self, state: &mut SharedGameState, npc_list: &NPCList) -> GameResult {
if !self.cond.alive() && self.life > 0 {
return Ok(());
} else if !self.cond.alive() && self.life == 0 {
self.popup.x = self.x;
self.popup.y = self.y - self.display_bounds.top as i32 + 0x1000;
self.popup.tick(state, ())?;
if !self.cond.alive() {
if self.life == 0 {
self.popup.x = self.x;
self.popup.y = self.y - self.display_bounds.top as i32 + 0x1000;
self.popup.tick(state, ())?;
}
return Ok(());
}