Fix LocalPlayer::isDead always returning false if player is immortal
[oweals/minetest.git] / src / client / localplayer.cpp
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)