Fixes
* poison condition * battle target outside screen view
This commit is contained in:
parent
fd2bc9fb77
commit
8a22b98d01
|
@ -270,7 +270,10 @@ function Battle.removeCreature(creature)
|
||||||
if lastBattleButtonSwitched == battleButtonsByCreaturesList[creatureId] then
|
if lastBattleButtonSwitched == battleButtonsByCreaturesList[creatureId] then
|
||||||
lastBattleButtonSwitched = nil
|
lastBattleButtonSwitched = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if battleButtonsByCreaturesList[creatureId].isTarget then
|
||||||
|
g_game.cancelAttack()
|
||||||
|
end
|
||||||
battleButtonsByCreaturesList[creatureId].creature:hideStaticSquare()
|
battleButtonsByCreaturesList[creatureId].creature:hideStaticSquare()
|
||||||
battleButtonsByCreaturesList[creatureId]:destroy()
|
battleButtonsByCreaturesList[creatureId]:destroy()
|
||||||
battleButtonsByCreaturesList[creatureId] = nil
|
battleButtonsByCreaturesList[creatureId] = nil
|
||||||
|
|
|
@ -91,9 +91,12 @@ end
|
||||||
|
|
||||||
function HealthBar.onStatesChange(localPlayer, now, old)
|
function HealthBar.onStatesChange(localPlayer, now, old)
|
||||||
local bitsChanged = bit32.bxor(now, old)
|
local bitsChanged = bit32.bxor(now, old)
|
||||||
|
print("HealthBar.onStatesChange 1 " .. bitsChanged)
|
||||||
for i = 1, 32 do
|
for i = 1, 32 do
|
||||||
if i > bitsChanged then break end
|
local pow = math.pow(2, i-1)
|
||||||
local bitChanged = bit32.band(bitsChanged, math.pow(2, i))
|
if pow > bitsChanged then break end
|
||||||
|
local bitChanged = bit32.band(bitsChanged, pow)
|
||||||
|
print("HealthBar.onStatesChange 2 " .. bitChanged .. " " .. bitsChanged .. " " .. pow)
|
||||||
if bitChanged ~= 0 then
|
if bitChanged ~= 0 then
|
||||||
HealthBar.toggleIcon(bitChanged)
|
HealthBar.toggleIcon(bitChanged)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue