summaryrefslogtreecommitdiff
path: root/src/hud.cpp
diff options
context:
space:
mode:
authorPilzAdam <pilzadam@minetest.net>2013-06-19 14:30:22 +0000
committerPilzAdam <pilzadam@minetest.net>2013-06-19 15:47:00 +0000
commit53066024f6a91d5f83241b379b94d8557d43a646 (patch)
treec785c98f2cc0b45a2430e0e6a374676cd0a175c4 /src/hud.cpp
parente65ac4d626f69656c57c07e4df1a1113a014f34a (diff)
downloadminetest-53066024f6a91d5f83241b379b94d8557d43a646.tar.gz
minetest-53066024f6a91d5f83241b379b94d8557d43a646.tar.bz2
minetest-53066024f6a91d5f83241b379b94d8557d43a646.zip
Add drowning
Diffstat (limited to 'src/hud.cpp')
-rw-r--r--src/hud.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/hud.cpp b/src/hud.cpp
index a3ae38bcb..9404ed997 100644
--- a/src/hud.cpp
+++ b/src/hud.cpp
@@ -278,7 +278,7 @@ void Hud::drawStatbar(v2s32 pos, u16 corner, u16 drawdir, std::string texture, s
}
-void Hud::drawHotbar(v2s32 centerlowerpos, s32 halfheartcount, u16 playeritem) {
+void Hud::drawHotbar(v2s32 centerlowerpos, s32 halfheartcount, u16 playeritem, s32 breath) {
InventoryList *mainlist = inventory->getList("main");
if (mainlist == NULL) {
errorstream << "draw_hotbar(): mainlist == NULL" << std::endl;
@@ -295,6 +295,9 @@ void Hud::drawHotbar(v2s32 centerlowerpos, s32 halfheartcount, u16 playeritem) {
if (player->hud_flags & HUD_FLAG_HEALTHBAR_VISIBLE)
drawStatbar(pos - v2s32(0, 4), HUD_CORNER_LOWER, HUD_DIR_LEFT_RIGHT,
"heart.png", halfheartcount, v2s32(0, 0));
+ if (player->hud_flags & HUD_FLAG_BREATHBAR_VISIBLE && breath <= 10)
+ drawStatbar(pos - v2s32(-180, 4), HUD_CORNER_LOWER, HUD_DIR_LEFT_RIGHT,
+ "bubble.png", breath*2, v2s32(0, 0));
}