From 4abdfa0ede56b9ed7aeb7c40a879e0d07d115da8 Mon Sep 17 00:00:00 2001 From: Gerkiz Date: Thu, 11 Feb 2021 21:16:00 +0100 Subject: [PATCH] health booster v2 - disable on entity died --- modules/biter_health_booster_v2.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/biter_health_booster_v2.lua b/modules/biter_health_booster_v2.lua index 25389868..1c396b88 100644 --- a/modules/biter_health_booster_v2.lua +++ b/modules/biter_health_booster_v2.lua @@ -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