summaryrefslogtreecommitdiff
path: root/src/hud.cpp
diff options
context:
space:
mode:
authorsapier <Sapier at GMX dot net>2014-05-11 00:35:31 +0200
committersapier <Sapier at GMX dot net>2014-05-11 22:34:44 +0200
commit6c37e89f08f962eaba788a31f5d3c798ceaa65e6 (patch)
tree3332dd691a5820b472fb4a2c649c860fee9bb340 /src/hud.cpp
parent167df02e3d69dd0e8c8915944e6bab00417b15d5 (diff)
downloadminetest-6c37e89f08f962eaba788a31f5d3c798ceaa65e6.tar.gz
minetest-6c37e89f08f962eaba788a31f5d3c798ceaa65e6.tar.bz2
minetest-6c37e89f08f962eaba788a31f5d3c798ceaa65e6.zip
Fix old client showing duplicated health bar on new server
Fix client not showing hearts and bubbles on connecting to old server Fix server not remembering hud flags correctly
Diffstat (limited to 'src/hud.cpp')
-rw-r--r--src/hud.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/hud.cpp b/src/hud.cpp
index f1d7a3258..7b601ec87 100644
--- a/src/hud.cpp
+++ b/src/hud.cpp
@@ -414,6 +414,23 @@ void Hud::drawHotbar(u16 playeritem) {
drawItems(secondpos, hotbar_itemcount, hotbar_itemcount/2, mainlist, playeritem + 1, 0);
}
}
+
+ //////////////////////////// compatibility code to be removed //////////////
+ // this is ugly as hell but there's no other way to keep compatibility to
+ // old servers
+ if ( player->hud_flags & HUD_FLAG_HEALTHBAR_VISIBLE)
+ drawStatbar(v2s32(floor(0.5 * (float) m_screensize.X + 0.5),
+ floor(1 * (float) m_screensize.Y + 0.5)),
+ HUD_CORNER_UPPER, 0, "heart.png",
+ player->hp, v2s32((-10*24)-25,-(48+24+10)), v2s32(24,24));
+
+ if ((player->hud_flags & HUD_FLAG_BREATHBAR_VISIBLE) &&
+ (player->getBreath() < 11))
+ drawStatbar(v2s32(floor(0.5 * (float) m_screensize.X + 0.5),
+ floor(1 * (float) m_screensize.Y + 0.5)),
+ HUD_CORNER_UPPER, 0, "heart.png",
+ player->getBreath(), v2s32(25,-(48+24+10)), v2s32(24,24));
+ ////////////////////////////////////////////////////////////////////////////
}