From 4d9f606f1176bb3f1533c6ea440ed58e1a9e6a6a Mon Sep 17 00:00:00 2001 From: MAOCI Date: Thu, 9 Mar 2023 18:18:50 +0100 Subject: [PATCH] Fix for alot of OTC's to not display health properly in circle bars. --- modules/game_healthcircle/game_healthcircle.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/game_healthcircle/game_healthcircle.lua b/modules/game_healthcircle/game_healthcircle.lua index 2c96fcb9c9..843031d3ce 100644 --- a/modules/game_healthcircle/game_healthcircle.lua +++ b/modules/game_healthcircle/game_healthcircle.lua @@ -166,7 +166,12 @@ end function whenHealthChange() if g_game.isOnline() then - local healthPercent = math.floor(g_game.getLocalPlayer():getHealthPercent()) + -- Fix By TheMaoci ~ if your server doesn't have this properly implemented, + -- it will cause alot of unnecessary deaths from players which will be unfair. + -- My friend reported me that while he was using his otcv8 and asked for a fix so here you go :) + local healthPercent = math.floor(g_game.getLocalPlayer():getHealth() / g_game.getLocalPlayer():getMaxHealth() * 100) + -- Old leaved for ppl who have that implemented correctly + --local healthPercent = math.floor(g_game.getLocalPlayer():getHealthPercent()) local yhppc = math.floor(imageSizeBroad * (1 - (healthPercent / 100))) local restYhppc = imageSizeBroad - yhppc