mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-01-06 00:23:49 +02:00
health booster v2 - disable on entity died
This commit is contained in:
parent
48a62d40c3
commit
4abdfa0ede
@ -32,6 +32,7 @@ function Public.reset_table()
|
||||
this.biter_health_boost_units = {}
|
||||
this.biter_health_boost_count = 0
|
||||
this.active_surface = 'nauvis'
|
||||
this.check_on_entity_died = false
|
||||
end
|
||||
|
||||
local entity_types = {
|
||||
@ -181,6 +182,10 @@ local function on_entity_damaged(event)
|
||||
end
|
||||
|
||||
local function on_entity_died(event)
|
||||
if not this.check_on_entity_died then
|
||||
return
|
||||
end
|
||||
|
||||
local biter = event.entity
|
||||
if not (biter and biter.valid) then
|
||||
return
|
||||
@ -225,6 +230,12 @@ function Public.set_active_surface(str)
|
||||
return this.active_surface
|
||||
end
|
||||
|
||||
function Public.check_on_entity_died(boolean)
|
||||
this.check_on_entity_died = boolean or false
|
||||
|
||||
return this.check_on_entity_died
|
||||
end
|
||||
|
||||
local on_init = function()
|
||||
Public.reset_table()
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user