1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-01-08 00:39:30 +02:00

broken module fix

This commit is contained in:
MewMew 2020-04-04 09:02:09 +02:00
parent 40062953d7
commit f4c5a315a6

View File

@ -72,7 +72,6 @@ local function on_entity_damaged(event)
local biter = event.entity
if not (biter and biter.valid) then return end
if biter.type ~= "unit" then return end
if event.final_damage_amount == 0 then return end
local biter_health_boost_units = global.biter_health_boost_units
@ -98,12 +97,9 @@ local function on_entity_damaged(event)
end
end
--Calculate current actual health, accounting for regeneration
local current_health = biter.health * (1 / health_pool[2])
--Reduce health pool
health_pool[1] = current_health - event.final_damage_amount
health_pool[1] = health_pool[1] - event.final_damage_amount
--Set entity health relative to health pool
biter.health = health_pool[1] * health_pool[2]