]> git.lizzy.rs Git - minetest.git/commitdiff
Fix LocalPlayer::isDead always returning false if player is immortal
authorANAND <ClobberXD@gmail.com>
Wed, 21 Aug 2019 13:04:47 +0000 (18:34 +0530)
committersfan5 <sfan5@live.de>
Sat, 14 Sep 2019 18:16:55 +0000 (20:16 +0200)
src/client/localplayer.cpp
src/client/localplayer.h

index 1b0b667c83c284cc8758a9fadc3249166be18454..3007a86e32ccfcc73c15375f50339a2230f202b1 100644 (file)
@@ -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)
index 252519aaaa4d06cc833e7f0de427752b60f3eaa2..539f1ba2aa58f6517f8a1d1a7e2ae10971ea6ee7 100644 (file)
@@ -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)
        {