Fix target square

The target square disappeared when using filters in the battle window.
This commit is contained in:
4drik 2019-11-20 10:08:25 +01:00 committed by diath
parent 6217d8805b
commit 521e87ca00

View File

@ -244,7 +244,11 @@ function doCreatureFitFilters(creature)
local localPlayer = g_game.getLocalPlayer() local localPlayer = g_game.getLocalPlayer()
if pos.z ~= localPlayer:getPosition().z or not creature:canBeSeen() then return false end if pos.z ~= localPlayer:getPosition().z or not creature:canBeSeen() then return false end
return true
end
function doShowCreatureAtBattle(creature)
if doCreatureFitFilters(creature) then
local hidePlayers = hidePlayersButton:isChecked() local hidePlayers = hidePlayersButton:isChecked()
local hideNPCs = hideNPCsButton:isChecked() local hideNPCs = hideNPCsButton:isChecked()
local hideMonsters = hideMonstersButton:isChecked() local hideMonsters = hideMonstersButton:isChecked()
@ -265,6 +269,8 @@ function doCreatureFitFilters(creature)
return true return true
end end
return false
end
function onCreatureHealthPercentChange(creature, health) function onCreatureHealthPercentChange(creature, health)
local battleButton = battleButtonsByCreaturesList[creature:getId()] local battleButton = battleButtonsByCreaturesList[creature:getId()]
@ -452,7 +458,7 @@ function addCreature(creature)
end end
local localPlayer = g_game.getLocalPlayer() local localPlayer = g_game.getLocalPlayer()
battleButton:setVisible(localPlayer:hasSight(creature:getPosition()) and creature:canBeSeen()) battleButton:setVisible(localPlayer:hasSight(creature:getPosition()) and creature:canBeSeen() and doShowCreatureAtBattle(creature))
end end
function removeAllCreatures() function removeAllCreatures()