Fix LocalPlayer::isDead always returning false if player is immortal

This commit is contained in:
ANAND 2019-08-21 18:34:47 +05:30 committed by sfan5
parent 81c7f0ae04
commit e2d6445f2a
2 changed files with 6 additions and 1 deletions

@ -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)

@ -149,7 +149,7 @@ public:
bool getAutojump() const { return m_autojump; }
bool isDead() const { return hp <= 0; }
bool isDead() const;
inline void addVelocity(const v3f &vel)
{