]> git.somenet.org - factorio/RealisticDecorationCleanup.git/blob - control.lua
091fb8872797b8c94479b77a92b4f9cc4fa2953c
[factorio/RealisticDecorationCleanup.git] / control.lua
1 --[[get dir of decorations under entities]]
2 script.on_event(defines.events.on_built_entity, function(event)
3         if event.created_entity.type ~= "entity-ghost" and event.created_entity.type ~= "tile-ghost" and event.created_entity.prototype.selectable_in_game then
4                 game.surfaces[event.created_entity.surface_index].destroy_decoratives{area=event.created_entity.selection_box}
5         end
6 end)
7
8 script.on_event(defines.events.on_robot_built_entity, function(event)
9         if event.created_entity.type ~= "entity-ghost" and event.created_entity.type ~= "tile-ghost" and event.created_entity.prototype.selectable_in_game then
10                 game.surfaces[event.created_entity.surface_index].destroy_decoratives{area=event.created_entity.selection_box}
11         end
12 end)
13
14 script.on_event(defines.events.script_raised_built, function(event)
15         if event.entity.type ~= "entity-ghost" and event.entity.type ~= "tile-ghost" and event.entity.prototype.selectable_in_game then
16                 game.surfaces[event.entity.surface_index].destroy_decoratives{area=event.entity.selection_box}
17         end
18 end)
19
20 script.on_event(defines.events.script_raised_revive, function(event)
21         if event.entity.type ~= "entity-ghost" and event.entity.type ~= "tile-ghost" and event.entity.prototype.selectable_in_game then
22                 game.surfaces[event.entity.surface_index].destroy_decoratives{area=event.entity.selection_box}
23         end
24 end)