fix orb sync when notplayer, fix ng+ as notplayer

This commit is contained in:
bgkillas 2024-08-27 17:00:55 -04:00
parent 83de7c4913
commit 1c74e6db4b
4 changed files with 26 additions and 5 deletions

View file

@ -107,7 +107,12 @@ function OnProjectileFired(shooter_id, projectile_id, initial_rng, position_x, p
end
EntityAddTag(projectile_id, "ew_no_enemy_sync")
local projectileComponent = EntityGetFirstComponentIncludingDisabled(projectile_id, "ProjectileComponent")
local entity_that_shot = ComponentGetValue2(projectileComponent, "mEntityThatShot")
local entity_that_shot
if projectileComponent == nil then
entity_that_shot = GameGetWorldStateEntity()
else
entity_that_shot = ComponentGetValue2(projectileComponent, "mEntityThatShot")
end
local shooter_player_data = player_fns.get_player_data_by_local_entity_id(shooter_id)
local rng = 0