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

Merge pull request #180 from hanakocz/master

fix for biter_health_booster deleting worms and spawners from the table
This commit is contained in:
Gerkiz 2020-07-19 16:37:24 +02:00 committed by GitHub
commit 790c334dda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,8 +25,12 @@ local function clean_table()
end
--Remove valid health boost entries from deletion
local validtypes = {}
for k,v in pairs(entity_types) do
if v then table.insert(validtypes, k) end
end
for _, surface in pairs(game.surfaces) do
for _, unit in pairs(surface.find_entities_filtered({type = "unit"})) do
for _, unit in pairs(surface.find_entities_filtered({type = validtypes})) do
units_to_delete[unit.unit_number] = nil
end
end
@ -91,7 +95,7 @@ local function on_entity_damaged(event)
else
Public.add_unit(biter, global.biter_health_boost)
end
health_pool = biter_health_boost_units[unit_number]
health_pool = global.biter_health_boost_units[unit_number]
end
--Process boss unit health bars