1 --[[get rid of decorations under entities]]
2 script.on_event(defines.events.on_built_entity, function(event)
3 if event.entity.type ~= "entity-ghost" and event.entity.type ~= "tile-ghost" and event.entity.prototype.selectable_in_game then
4 game.surfaces[event.entity.surface_index].destroy_decoratives{area={{event.entity.selection_box.left_top.x-0.6, event.entity.selection_box.left_top.y-0.6}, {event.entity.selection_box.right_bottom.x+0.6, event.entity.selection_box.right_bottom.y+0.6}}}
8 script.on_event(defines.events.on_robot_built_entity, function(event)
9 if event.entity.type ~= "entity-ghost" and event.entity.type ~= "tile-ghost" and event.entity.prototype.selectable_in_game then
10 game.surfaces[event.entity.surface_index].destroy_decoratives{area={{event.entity.selection_box.left_top.x-0.6, event.entity.selection_box.left_top.y-0.6}, {event.entity.selection_box.right_bottom.x+0.6, event.entity.selection_box.right_bottom.y+0.6}}}
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.left_top.x-0.6, event.entity.selection_box.left_top.y-0.6}, {event.entity.selection_box.right_bottom.x+0.6, event.entity.selection_box.right_bottom.y+0.6}}}
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.left_top.x-0.6, event.entity.selection_box.left_top.y-0.6}, {event.entity.selection_box.right_bottom.x+0.6, event.entity.selection_box.right_bottom.y+0.6}}}