prevent enter dying loop
This commit is contained in:
parent
2f9f13f74b
commit
f434e9ee9b
|
@ -1388,12 +1388,14 @@ function Room:changeHp(player, num, reason, skillName, damageStruct)
|
||||||
self.logic:trigger(fk.HpChanged, player, data)
|
self.logic:trigger(fk.HpChanged, player, data)
|
||||||
|
|
||||||
if player.hp < 1 then
|
if player.hp < 1 then
|
||||||
|
if num < 0 then
|
||||||
---@type DyingStruct
|
---@type DyingStruct
|
||||||
local dyingStruct = {
|
local dyingStruct = {
|
||||||
who = player.id,
|
who = player.id,
|
||||||
damage = damageStruct,
|
damage = damageStruct,
|
||||||
}
|
}
|
||||||
self:enterDying(dyingStruct)
|
self:enterDying(dyingStruct)
|
||||||
|
end
|
||||||
elseif player.dying then
|
elseif player.dying then
|
||||||
player.dying = false
|
player.dying = false
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue