From 3c395d908f016158162f022f24d7ea48eeb7e8d5 Mon Sep 17 00:00:00 2001 From: ANAND Date: Sat, 4 May 2019 12:43:31 +0530 Subject: Disable autoforward if player is dead --- src/client/localplayer.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/client/localplayer.h') diff --git a/src/client/localplayer.h b/src/client/localplayer.h index 16e7996ae..252519aaa 100644 --- a/src/client/localplayer.h +++ b/src/client/localplayer.h @@ -100,7 +100,7 @@ public: bool makes_footstep_sound = true; int last_animation = NO_ANIM; - float last_animation_speed; + float last_animation_speed = 0.0f; std::string hotbar_image = ""; std::string hotbar_selected_image = ""; @@ -149,6 +149,8 @@ public: bool getAutojump() const { return m_autojump; } + bool isDead() const { return hp <= 0; } + inline void addVelocity(const v3f &vel) { added_velocity += vel; -- cgit v1.2.3