]> git.somenet.org - factorio/RealisticDecorationCleanup.git/blob - control.lua
RELEASE 1.1.3 - fix decoration cleanup on non-nauvis.
[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)