1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-04 09:42:30 +02:00

fixed zero size area bug

This commit is contained in:
grilledham 2018-06-24 23:31:08 +01:00
parent feb416fb05
commit 36af281e7c

View File

@ -48,7 +48,13 @@ local function on_player_deconstructed_area(event)
end
character.health = 0
local entities = player.surface.find_entities_filtered{area = event.area, force = player.force}
local area = event.area
local left_top, right_bottom = area.left_top, area.right_bottom
if left_top.x == right_bottom.x and left_top.y == right_bottom.y then
return
end
local entities = player.surface.find_entities_filtered{area = area, force = player.force}
if #entities > 1000 then
Utils.print_admins("Warning! " .. player.name .. " just tried to deconstruct " .. tostring(#entities) .. " entities!")
end