diff --git a/modules/game_battle/battle.lua b/modules/game_battle/battle.lua index 5c25bdc7..d9dba2e8 100644 --- a/modules/game_battle/battle.lua +++ b/modules/game_battle/battle.lua @@ -279,10 +279,7 @@ function Battle.removeCreature(creature) if lastBattleButtonSwitched == battleButtonsByCreaturesList[creatureId] then lastBattleButtonSwitched = nil end - - if battleButtonsByCreaturesList[creatureId].isTarget then - g_game.cancelAttack() - end + battleButtonsByCreaturesList[creatureId].creature:hideStaticSquare() battleButtonsByCreaturesList[creatureId]:destroy() battleButtonsByCreaturesList[creatureId] = nil diff --git a/modules/game_healthbar/healthbar.lua b/modules/game_healthbar/healthbar.lua index 7a0ce495..c4da7dee 100644 --- a/modules/game_healthbar/healthbar.lua +++ b/modules/game_healthbar/healthbar.lua @@ -30,7 +30,7 @@ function HealthBar.init() connect(LocalPlayer, { onHealthChange = HealthBar.onHealthChange, onManaChange = HealthBar.onManaChange, onStatesChange = HealthBar.onStatesChange }) - + connect(g_game, { onGameEnd = HealthBar.offline }) healthBarWindow = displayUI('healthbar.otui', GameInterface.getLeftPanel()) @@ -52,7 +52,7 @@ function HealthBar.terminate() disconnect(LocalPlayer, { onHealthChange = HealthBar.onHealthChange, onManaChange = HealthBar.onManaChange, onStatesChange = HealthBar.onStatesChange }) - + disconnect(g_game, { onGameEnd = HealthBar.offline }) healthBarWindow:destroy() @@ -71,6 +71,10 @@ function HealthBar.toggle() healthBarButton:setOn(visible) end +function HealthBar.offline() + healthBarWindow:recursiveGetChildById('conditions_content'):destroyChildren() +end + -- hooked events function HealthBar.onHealthChange(localPlayer, health, maxHealth) healthLabel:setText(health .. ' / ' .. maxHealth) @@ -115,9 +119,3 @@ function HealthBar.toggleIcon(bitChanged) end end -function HealthBar.offline() - local conditionsContent = healthBarWindow:recursiveGetChildById('conditions_content') - local count = conditionsContent:getChildCount() - for i = count, 1, -1 do conditionsContent:getChildByIndex(i):destroy() end -end - diff --git a/modules/game_healthbar/icons/protection_zone_Block.png b/modules/game_healthbar/icons/protection_zone_Block.png deleted file mode 100644 index 47bcade8..00000000 Binary files a/modules/game_healthbar/icons/protection_zone_Block.png and /dev/null differ diff --git a/src/otclient/core/localplayer.cpp b/src/otclient/core/localplayer.cpp index 567e7fcb..4ef55c60 100644 --- a/src/otclient/core/localplayer.cpp +++ b/src/otclient/core/localplayer.cpp @@ -237,7 +237,6 @@ void LocalPlayer::setLevel(double level, double levelPercent) m_level = level; m_levelPercent = levelPercent; - dump << "yeah"; callLuaField("onLevelChange", level, levelPercent, oldLevel, oldLevelPercent); } }