1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-14 10:13:13 +02:00

fixed cave collapse causing stress corruption

This commit is contained in:
Maik Wild 2018-10-09 15:50:42 +02:00
parent 2e904925fb
commit 5d5c22c109

View File

@ -90,7 +90,16 @@ local function create_collapse_template(positions, surface)
for _, new_spawn in pairs({entities, tiles}) do
for _, tile in pairs(new_spawn) do
for _, entity in pairs(surface.find_entities_filtered({position = tile.position})) do
pcall(function() entity.die() end)
pcall(function()
local strength = support_beam_entities[entity.name]
local position = entity.position
local surface = entity.surface
entity.die()
if strength then
stress_map_blur_add(surface, position, strength)
end
end)
end
end
end