File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -26,3 +26,4 @@ remote.add_interface("se-little-inferno", {
26
26
})
27
27
28
28
script .on_event (defines .events .on_gui_click , handler .on_gui_click )
29
+ script .on_event (defines .events .on_trigger_created_entity , handler .on_trigger_created_entity )
Original file line number Diff line number Diff line change 6
6
"author" : " Quezler" ,
7
7
"factorio_version" : " 1.1" ,
8
8
"dependencies" : [
9
- " space-exploration"
9
+ " space-exploration" ,
10
+ " space-exploration-scripts >= 1.0.10"
10
11
]
11
12
}
Original file line number Diff line number Diff line change 1
1
util = require (" util" )
2
+ local Zone = require (' __space-exploration-scripts__.zone' )
2
3
3
4
local Handler = {}
4
5
@@ -186,4 +187,18 @@ function Handler.on_gui_click(event)
186
187
script .on_event (defines .events .on_tick , Handler .on_tick )
187
188
end
188
189
190
+ function Handler .on_trigger_created_entity (event )
191
+ if not event .entity and event .entity .valid then return end
192
+ local entity_name = event .entity .name
193
+
194
+ if entity_name == ' se-plague-cloud' then
195
+ local surface_index = event .entity .surface .index
196
+ local zone = Zone .from_surface_index (surface_index )
197
+
198
+ if zone and Zone .is_solid (zone ) then
199
+ Handler .set_enabled_for_surface_index ({surface_index = surface_index , enabled = true })
200
+ end
201
+ end
202
+ end
203
+
189
204
return Handler
You can’t perform that action at this time.
0 commit comments