add nil checks, add freezing vapor

This commit is contained in:
bgkillas 2024-08-21 17:46:01 -04:00
parent f657f811a5
commit 455ec4f0c7
3 changed files with 8 additions and 5 deletions

View file

@ -481,12 +481,14 @@ function enemy_sync.on_projectile_fired(shooter_id, projectile_id, initial_rng,
local not_a_player = not EntityHasTag(shooter_id, "ew_no_enemy_sync") and not EntityHasTag(shooter_id, "player_unit") and not EntityHasTag(shooter_id, "ew_client")
if not_a_player and ctx.is_host then
local projectileComponent = EntityGetFirstComponentIncludingDisabled(projectile_id, "ProjectileComponent")
if projectileComponent ~= nil then
local entity_that_shot = ComponentGetValue2(projectileComponent, "mEntityThatShot")
if entity_that_shot == 0 then
rpc.replicate_projectile(np.SerializeEntity(projectile_id), position_x, position_y, target_x, target_y, shooter_id, initial_rng)
end
end
end
end
rpc.opts_reliable()
function rpc.replicate_projectile(seri_ent, position_x, position_y, target_x, target_y, remote_source_ent, rng)

View file

@ -33,6 +33,7 @@ local bad_mats = {"magic_liquid_random_polymorph",
"beer",
"alcohol",
"sima",
"blood_cold",
"juhannussima",
"slime",
"slime_yellow",
@ -529,7 +530,7 @@ local function set_camera_pos()
camera_target = ctx.my_player.entity
end
if camera_target ~= cam_target then
if ctx.my_player.entity ~= camera_target then
if ctx.my_player.entity ~= camera_target and inventory_target ~= nil then
EntityRemoveComponent(camera_target, inventory_target)
end

View file

@ -130,7 +130,7 @@ function OnProjectileFired(shooter_id, projectile_id, initial_rng, position_x, p
rng = initial_rng
table.insert(shooter_player_data.projectile_rng_init, rng)
else
rng = shooter_player_data.projectile_seed_chain[entity_that_shot] + 25
rng = (shooter_player_data.projectile_seed_chain[entity_that_shot] or 0) + 25
end
else
if (entity_that_shot == 0 and multicast_index ~= -1 and unknown3 == 0) then