mirror of
https://github.com/ComfyFactory/ComfyFactorio.git
synced 2025-03-17 20:58:13 +02:00
minor fix
/clear-corpses now clears near the player.
This commit is contained in:
parent
95bc3d473a
commit
15299c01b2
@ -294,10 +294,11 @@ commands.add_command(
|
||||
end
|
||||
if param == nil then player.print("[ERROR] Must specify radius!", Color.fail) return end
|
||||
if param > 500 then player.print("[ERROR] Value is too big.", Color.fail) return end
|
||||
local pos = player.position
|
||||
|
||||
local radius = {{x = -param, y = -param}, {x = param, y = param}} or {{x = -1, y = -1}, {x = 1, y = 1}}
|
||||
local radius = {{x = (pos.x + -param), y = (pos.y + -param)}, {x = (pos.x + param), y = (pos.y + param)}}
|
||||
for _, entity in pairs(player.surface.find_entities_filtered{area = radius, type = "corpse"}) do
|
||||
player.print("Cleared biter-corpses.", Color.success)
|
||||
entity.destroy()
|
||||
end
|
||||
end)
|
||||
player.print("Cleared biter-corpses.", Color.success)
|
||||
end)
|
||||
|
Loading…
x
Reference in New Issue
Block a user