ensure streaming keep alive

This commit is contained in:
bgkillas 2024-11-17 00:12:35 -05:00
parent 01cd69f640
commit 70002c6c04

View file

@ -609,7 +609,7 @@ function player_fns.replace_player_entity(new_entity, player_data)
local old_entity = player_data.entity
player_data.entity = new_entity
ctx.player_data_by_local_entity[new_entity] = player_data
if player_data.peer_id ~= ctx.my_player.peer_id then
if EntityGetFirstComponentIncludingDisabled(new_entity, "StreamingKeepAliveComponent") == nil then
EntityAddComponent2(new_entity, "StreamingKeepAliveComponent")
end
print("Replaced player entity: "..old_entity.." -> "..new_entity)