summaryrefslogtreecommitdiff
path: root/src/player.h
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2015-03-12 11:27:28 +0100
committerLoic Blot <loic.blot@unix-experience.fr>2015-03-12 11:27:28 +0100
commitafb19f3a1f73d36207b8b64e4eed5846e78f5a32 (patch)
tree2088237d52a9d21d091f0e7a11c3ca4cf9528df4 /src/player.h
parent3067d782169a79ab3b13e8ba3d445b60d0d477c5 (diff)
downloadminetest-afb19f3a1f73d36207b8b64e4eed5846e78f5a32.tar.gz
minetest-afb19f3a1f73d36207b8b64e4eed5846e78f5a32.tar.bz2
minetest-afb19f3a1f73d36207b8b64e4eed5846e78f5a32.zip
handleCommand_Breath mustn't update breath is player is dead. A dead player doesn't breath.
Add Player::isDead function to check player is dead
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/player.h b/src/player.h
index 4459b421a..def428847 100644
--- a/src/player.h
+++ b/src/player.h
@@ -238,6 +238,9 @@ public:
inventory.setModified(x);
}
+ // Use a function, if isDead can be defined by other conditions
+ bool isDead() { return hp == 0; }
+
bool touching_ground;
// This oscillates so that the player jumps a bit above the surface
bool in_liquid;