mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
fix camera being sent to 0,0 on end fight death
This commit is contained in:
parent
e73dbc9f02
commit
e8e1343244
2 changed files with 19 additions and 14 deletions
|
@ -384,13 +384,13 @@ function inventory_helper.set_item_data(item_data, player_data)
|
|||
np.SetActiveHeldEntity(player, active_item_entity, false, false)
|
||||
end
|
||||
end
|
||||
local inventory2Comp = EntityGetFirstComponentIncludingDisabled(player, "Inventory2Component")
|
||||
if inventory2Comp ~= nil then
|
||||
async(function()
|
||||
wait(1)
|
||||
async(function()
|
||||
wait(1)
|
||||
local inventory2Comp = EntityGetFirstComponentIncludingDisabled(player, "Inventory2Component")
|
||||
if inventory2Comp ~= nil then
|
||||
ComponentSetValue2(inventory2Comp, "mForceRefresh", true)
|
||||
end)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function inventory_helper.has_inventory_changed(player_data)
|
||||
|
|
|
@ -172,18 +172,23 @@ local function player_died()
|
|||
end
|
||||
|
||||
local function do_game_over(message)
|
||||
GameSetCameraFree(false)
|
||||
net.proxy_notify_game_over()
|
||||
ctx.run_ended = true
|
||||
GameRemoveFlagRun("ew_flag_notplayer_active")
|
||||
ctx.my_player.entity = end_poly_effect(ctx.my_player.entity)
|
||||
local damage_model = EntityGetFirstComponentIncludingDisabled(ctx.my_player.entity, "DamageModelComponent")
|
||||
if damage_model ~= nil then
|
||||
ComponentSetValue2(damage_model, "wait_for_kill_flag_on_death", false)
|
||||
EntityInflictDamage(ctx.my_player.entity, 1000000, "DAMAGE_CURSE", message, "NONE", 0, 0, GameGetWorldStateEntity())
|
||||
GameRemoveFlagRun("ew_flag_notplayer_active")
|
||||
if damage_model ~= nil and #EntityGetAllChildren(ctx.my_player.entity) ~= 0 then
|
||||
GameSetCameraFree(false)
|
||||
ctx.my_player.entity = end_poly_effect(ctx.my_player.entity)
|
||||
if ctx.my_player.entity ~= nil then
|
||||
ComponentSetValue2(damage_model, "wait_for_kill_flag_on_death", false)
|
||||
EntityInflictDamage(ctx.my_player.entity, 1000000, "DAMAGE_CURSE", message, "NONE", 0, 0, GameGetWorldStateEntity())
|
||||
GameTriggerGameOver()
|
||||
EntityKill(ctx.my_player.entity)
|
||||
end
|
||||
else
|
||||
GameSetCameraFree(true)
|
||||
GameTriggerGameOver()
|
||||
end
|
||||
GameTriggerGameOver()
|
||||
EntityKill(ctx.my_player.entity)
|
||||
end
|
||||
|
||||
function module.on_local_player_spawn(my_player)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue