Skip to content
Permalink
Browse files

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

  • Loading branch information
ClobberXD authored and sfan5 committed Aug 21, 2019
1 parent 81c7f0a commit e2d6445f2a64c45437f9762b891413142c4a66a3
Showing with 6 additions and 1 deletion.
  1. +5 −0 src/client/localplayer.cpp
  2. +1 −1 src/client/localplayer.h
@@ -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 @@ 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)
{

0 comments on commit e2d6445

Please sign in to comment.
You can’t perform that action at this time.