From 362ab0e1c675c8788a186ee25af2a6f7aaec248f Mon Sep 17 00:00:00 2001 From: AndreFaramir Date: Wed, 6 Jun 2012 23:16:18 -0300 Subject: [PATCH] fix conditions on reload --- modules/game_healthbar/healthbar.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/game_healthbar/healthbar.lua b/modules/game_healthbar/healthbar.lua index 0bd794ab..bee3ad6e 100644 --- a/modules/game_healthbar/healthbar.lua +++ b/modules/game_healthbar/healthbar.lua @@ -47,6 +47,7 @@ function HealthBar.init() local localPlayer = g_game.getLocalPlayer() HealthBar.onHealthChange(localPlayer, localPlayer:getHealth(), localPlayer:getMaxHealth()) HealthBar.onManaChange(localPlayer, localPlayer:getMana(), localPlayer:getMaxMana()) + HealthBar.onStatesChange(localPlayer, localPlayer:getStates(), 0) end end @@ -98,6 +99,8 @@ function HealthBar.onManaChange(localPlayer, mana, maxMana) end function HealthBar.onStatesChange(localPlayer, now, old) + if now == old then return end + local bitsChanged = bit32.bxor(now, old) for i = 1, 32 do local pow = math.pow(2, i-1)