Code: Select all
local function dummy_marks_fire(dummy)
-- Check argument
if not (dummy and dummy.valid) then
error("Wrong arguments for function dummy_marks_fire(dummy): Dummy is not valid!\n")
end
local fires = dummy.surface.find_entities_filtered{
type = "fire",
position = dummy.position,
radius = WT.fire_dummy_radius,
}
WT.show("Fires found around " .. WT.print_name_id(dummy), fires and table_size(fires))
if table_size(fires) == 0 then
dummy.destroy()
return nil
end
return fires
end
This works if there are just one or two markers, but the picture shows a situation where the markers remain in place because fire is found:
Code: Select all
487.556 Script @__WaterTurret__/common.lua:38: Entered function dummy_marks_fire(fire-dummy (208)) on tick 19438.
487.556 Script @__WaterTurret__/common.lua:38: Fires found around fire-dummy (208): 1
487.556 Script @__WaterTurret__/common.lua:38: fires: {
{
__self = "userdata"
}
}
487.557 Script @__WaterTurret__/common.lua:38: End of function dummy_marks_fire(fire-dummy (208)) on tick 19438.