mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 15:13:16 +00:00
Fix client dying on host before shared health is depleted.
This commit is contained in:
parent
94432c21e1
commit
c08db2bad2
1 changed files with 10 additions and 0 deletions
|
@ -10,4 +10,14 @@ function damage_received(damage, message, entity_thats_responsible, is_fatal, pr
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
ComponentSetValue2(host_damageModelComponent, "hp", health - damage)
|
ComponentSetValue2(host_damageModelComponent, "hp", health - damage)
|
||||||
|
|
||||||
|
-- Change our health back
|
||||||
|
local entity_id = GetUpdatedEntityID();
|
||||||
|
local damageModelComponent = EntityGetFirstComponentIncludingDisabled( entity_id, "DamageModelComponent" )
|
||||||
|
if damageModelComponent ~= nil then
|
||||||
|
local health = ComponentGetValue2( damageModelComponent, "hp" )
|
||||||
|
if health then
|
||||||
|
ComponentSetValue2( damageModelComponent, "hp", health + damage )
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue