mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
fix some edgecases with spectating and such
This commit is contained in:
parent
ebb28b80f7
commit
81bbd5a96d
4 changed files with 7 additions and 4 deletions
|
@ -135,7 +135,7 @@ local function get_sync_entities(return_all)
|
|||
else
|
||||
table_extend_filtered(entities2, entities, function(ent)
|
||||
local x, y = EntityGetTransform(ent)
|
||||
local has_anyone = #EntityGetInRadiusWithTag(x, y, DISTANCE_LIMIT, "ew_peer") > 0
|
||||
local has_anyone = #EntityGetInRadiusWithTag(x, y, DISTANCE_LIMIT, "ew_client") > 0
|
||||
if not has_anyone then
|
||||
skipped_counter = skipped_counter + 1
|
||||
end
|
||||
|
|
|
@ -116,6 +116,7 @@ local function player_died()
|
|||
EntityAddChild(ctx.my_player.entity, iron)
|
||||
rpc.add_nickname(ctx.my_id)
|
||||
remove_healthbar_locally()
|
||||
EntityAddComponent2(ctx.my_player.entity, "StreamingKeepAliveComponent")
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
|
@ -390,9 +390,6 @@
|
|||
<WalletComponent>
|
||||
</WalletComponent>
|
||||
|
||||
<StreamingKeepAliveComponent>
|
||||
</StreamingKeepAliveComponent>
|
||||
|
||||
<KickComponent>
|
||||
</KickComponent>
|
||||
|
||||
|
|
|
@ -637,9 +637,14 @@ local function set_camera_pos()
|
|||
inventory_target = EntityAddComponent2(cam_target, "InventoryGuiComponent")
|
||||
end
|
||||
local audio = EntityGetFirstComponent(camera_target, "AudioListenerComponent")
|
||||
local keep_alive = EntityGetFirstComponent(camera_target, "StreamingKeepAliveComponent")
|
||||
if audio ~= nil then
|
||||
EntityRemoveComponent(camera_target, audio)
|
||||
if camera_target ~= ctx.my_player.ent then
|
||||
EntityRemoveComponent(camera_target, keep_alive)
|
||||
end
|
||||
EntityAddComponent2(cam_target, "AudioListenerComponent")
|
||||
EntityAddComponent2(cam_target, "StreamingKeepAliveComponent")
|
||||
end
|
||||
end
|
||||
camera_target = cam_target
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue