Skip to content

Commit

Permalink
Fix LocalPlayer::isDead always returning false if player is immortal
Browse files Browse the repository at this point in the history
  • Loading branch information
ClobberXD authored and sfan5 committed Sep 14, 2019
1 parent 81c7f0a commit e2d6445
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/client/localplayer.cpp
Expand Up @@ -732,6 +732,11 @@ v3f LocalPlayer::getEyeOffset() const
return v3f(0, BS * eye_height, 0);
}

bool LocalPlayer::isDead() const
{
return !getCAO()->isImmortal() && hp == 0;
}

// 3D acceleration
void LocalPlayer::accelerate(const v3f &target_speed, const f32 max_increase_H,
const f32 max_increase_V, const bool use_pitch)
Expand Down
2 changes: 1 addition & 1 deletion src/client/localplayer.h
Expand Up @@ -149,7 +149,7 @@ class LocalPlayer : public Player

bool getAutojump() const { return m_autojump; }

bool isDead() const { return hp <= 0; }
bool isDead() const;

inline void addVelocity(const v3f &vel)
{
Expand Down

0 comments on commit e2d6445

Please sign in to comment.