mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
fix crash after end fight
This commit is contained in:
parent
625ff4195c
commit
164cdabb76
2 changed files with 6 additions and 5 deletions
|
@ -69,6 +69,9 @@ local function remove_fire(entity)
|
|||
end
|
||||
|
||||
local function remove_status(entity, little)
|
||||
if EntityGetFirstComponent(entity, "StatusEffectDataComponent") == nil then
|
||||
return
|
||||
end
|
||||
if little then
|
||||
EntityRemoveStainStatusEffect(entity, status_effects[24].id)
|
||||
EntityRemoveIngestionStatusEffect(entity, status_effects[24].id)
|
||||
|
@ -183,9 +186,7 @@ function end_fight.on_world_update()
|
|||
for _, child in ipairs(EntityGetAllChildren(entity) or {}) do
|
||||
EntityKill(child)
|
||||
end
|
||||
if not ctx.run_ended then
|
||||
remove_status(entity)
|
||||
end
|
||||
remove_status(entity)
|
||||
end
|
||||
::continue::
|
||||
end
|
||||
|
|
|
@ -309,7 +309,7 @@ ctx.cap.health = {
|
|||
end
|
||||
end
|
||||
end
|
||||
if not ctx.run_ended then
|
||||
if EntityGetFirstComponent(ctx.my_player.entity, "StatusEffectDataComponent") ~= nil then
|
||||
for _, effect in pairs(status_effects) do
|
||||
if EntityGetIsAlive(ctx.my_player.entity) then
|
||||
EntityRemoveStainStatusEffect(ctx.my_player.entity, effect.id)
|
||||
|
@ -375,7 +375,7 @@ function rpc.trigger_game_over(message)
|
|||
for _, child in ipairs(EntityGetAllChildren(entity) or {}) do
|
||||
EntityKill(child)
|
||||
end
|
||||
if not ctx.run_ended then
|
||||
if EntityGetFirstComponent(entity, "StatusEffectDataComponent") ~= nil then
|
||||
for _, effect in pairs(status_effects) do
|
||||
if EntityGetIsAlive(entity) then
|
||||
EntityRemoveStainStatusEffect(entity, effect.id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue