mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 15:13: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
|
end
|
||||||
|
|
||||||
local function remove_status(entity, little)
|
local function remove_status(entity, little)
|
||||||
|
if EntityGetFirstComponent(entity, "StatusEffectDataComponent") == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
if little then
|
if little then
|
||||||
EntityRemoveStainStatusEffect(entity, status_effects[24].id)
|
EntityRemoveStainStatusEffect(entity, status_effects[24].id)
|
||||||
EntityRemoveIngestionStatusEffect(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
|
for _, child in ipairs(EntityGetAllChildren(entity) or {}) do
|
||||||
EntityKill(child)
|
EntityKill(child)
|
||||||
end
|
end
|
||||||
if not ctx.run_ended then
|
remove_status(entity)
|
||||||
remove_status(entity)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
::continue::
|
::continue::
|
||||||
end
|
end
|
||||||
|
|
|
@ -309,7 +309,7 @@ ctx.cap.health = {
|
||||||
end
|
end
|
||||||
end
|
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
|
for _, effect in pairs(status_effects) do
|
||||||
if EntityGetIsAlive(ctx.my_player.entity) then
|
if EntityGetIsAlive(ctx.my_player.entity) then
|
||||||
EntityRemoveStainStatusEffect(ctx.my_player.entity, effect.id)
|
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
|
for _, child in ipairs(EntityGetAllChildren(entity) or {}) do
|
||||||
EntityKill(child)
|
EntityKill(child)
|
||||||
end
|
end
|
||||||
if not ctx.run_ended then
|
if EntityGetFirstComponent(entity, "StatusEffectDataComponent") ~= nil then
|
||||||
for _, effect in pairs(status_effects) do
|
for _, effect in pairs(status_effects) do
|
||||||
if EntityGetIsAlive(entity) then
|
if EntityGetIsAlive(entity) then
|
||||||
EntityRemoveStainStatusEffect(entity, effect.id)
|
EntityRemoveStainStatusEffect(entity, effect.id)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue