1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2025-03-17 20:58:13 +02:00

if threat_value[entity.name] does not exist, don't try to use it

This commit is contained in:
Gerkiz 2020-05-01 01:02:19 +02:00
parent 037cbb7398
commit e8ebb85574

View File

@ -161,9 +161,10 @@ end
local function on_entity_died(event)
local wave_defense_table = WD.get_table()
local entity = event.entity
if not entity.valid then return end
if not entity.valid then return end
if entity.type == "unit" then
if not threat_values[entity.name] then return end
wave_defense_table.threat = math.round(wave_defense_table.threat - threat_values[entity.name] * global.biter_health_boost, 2)
remove_unit(entity)
--acid_nova(entity)