fix blob spawning stuff still, fix enemys not bleeding on clients~

This commit is contained in:
bgkillas 2024-09-14 12:54:17 -04:00
parent 8d2b965b0a
commit 3ec3e478d2

View file

@ -471,7 +471,13 @@ function rpc.handle_enemy_data(enemy_data)
spawned_by_us[enemy_id] = true
EntityAddTag(enemy_id, "ew_replicated")
EntityAddTag(enemy_id, "polymorphable_NOT")
EntityAddComponent2(enemy_id, "LuaComponent", {_tags="ew_immortal", script_damage_about_to_be_received = "mods/quant.ew/files/resource/cbs/immortal.lua"})
for _, com in ipairs(EntityGetComponent(enemy_id, "LuaComponent") or {}) do
local script = ComponentGetValue2(com, "script_damage_received")
if script ~= nil and (script == "data/scripts/animals/leader_damage.lua" or script == "data/scripts/animals/giantshooter_death.lua" or script == "data/scripts/animals/blob_damage.lua") then
EntityRemoveComponent(enemy_id, com)
end
end
--EntityAddComponent2(enemy_id, "LuaComponent", {_tags="ew_immortal", script_damage_about_to_be_received = "mods/quant.ew/files/resource/cbs/immortal.lua"})
local damage_component = EntityGetFirstComponentIncludingDisabled(enemy_id, "DamageModelComponent")
if damage_component and damage_component ~= 0 then
ComponentSetValue2(damage_component, "wait_for_kill_flag_on_death", true)
@ -490,13 +496,6 @@ function rpc.handle_enemy_data(enemy_data)
end
end
for _, com in ipairs(EntityGetComponent(enemy_id, "LuaComponent") or {}) do
local script = ComponentGetValue2(com, "script_damage_received")
if script ~= nil and (script == "data/scripts/animals/leader_damage.lua" or script == "data/scripts/animals/giantshooter_death.lua") then
EntityRemoveComponent(enemy_id, com)
end
end
-- Make sure stuff doesn't decide to explode on clients by itself.
local expl_component = EntityGetFirstComponent(enemy_id, "ExplodeOnDamageComponent")
if expl_component ~= nil and expl_component ~= 0 then