From d0d2afe0f62ea35be583cb89ff126b2cc3464980 Mon Sep 17 00:00:00 2001
From: Someone <someone@somenet.org>
Date: Tue, 17 Jan 2023 20:41:59 +0100
Subject: [PATCH] RELEASE 1.1.2 - add support for Tapeline mod (hopefully)

---
 License.txt   | 2 +-
 changelog.txt | 7 +++++++
 control.lua   | 8 ++++----
 info.json     | 2 +-
 4 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/License.txt b/License.txt
index ae7e15e..6c79670 100644
--- a/License.txt
+++ b/License.txt
@@ -1,4 +1,4 @@
-Copyright (c) 2018-2020 Someone <someone@somenet.org>
+Copyright (c) 2018-2023 Someone <someone@somenet.org>
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/changelog.txt b/changelog.txt
index 9e8af42..10f0a74 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,3 +1,10 @@
+---------------------------------------------------------------------------------------------------
+Version: 1.1.2
+Date: 2022-01-17
+
+  Changed:
+    - add support for Tapeline mod (hopefully)
+
 ---------------------------------------------------------------------------------------------------
 Version: 1.1.1
 Date: 2021-02-14
diff --git a/control.lua b/control.lua
index bdf4f79..6ec133e 100644
--- a/control.lua
+++ b/control.lua
@@ -1,24 +1,24 @@
 --[[get dir of decorations under entities]]
 script.on_event(defines.events.on_built_entity, function(event)
-	if event.created_entity.type ~= "entity-ghost" and event.created_entity.type ~= "tile-ghost" then
+	if event.created_entity.type ~= "entity-ghost" and event.created_entity.type ~= "tile-ghost" and event.created_entity.prototype.selectable_in_game then
 		game.surfaces[1].destroy_decoratives{area=event.created_entity.selection_box}
 	end
 end)
 
 script.on_event(defines.events.on_robot_built_entity, function(event)
-	if event.created_entity.type ~= "entity-ghost" and event.created_entity.type ~= "tile-ghost" then
+	if event.created_entity.type ~= "entity-ghost" and event.created_entity.type ~= "tile-ghost" and event.created_entity.prototype.selectable_in_game then
 		game.surfaces[1].destroy_decoratives{area=event.created_entity.selection_box}
 	end
 end)
 
 script.on_event(defines.events.script_raised_built, function(event)
-	if event.entity.type ~= "entity-ghost" and event.entity.type ~= "tile-ghost" then
+	if event.entity.type ~= "entity-ghost" and event.entity.type ~= "tile-ghost" and event.entity.prototype.selectable_in_game then
 		game.surfaces[1].destroy_decoratives{area=event.entity.selection_box}
 	end
 end)
 
 script.on_event(defines.events.script_raised_revive, function(event)
-	if event.entity.type ~= "entity-ghost" and event.entity.type ~= "tile-ghost" then
+	if event.entity.type ~= "entity-ghost" and event.entity.type ~= "tile-ghost" and event.entity.prototype.selectable_in_game then
 		game.surfaces[1].destroy_decoratives{area=event.entity.selection_box}
 	end
 end)
diff --git a/info.json b/info.json
index 55678ab..1719656 100644
--- a/info.json
+++ b/info.json
@@ -1,6 +1,6 @@
 {
     "name": "RealisticDecorationCleanup",
-    "version": "1.1.1",
+    "version": "1.1.2",
     "title": "Realistic Decoration Cleanup",
     "author": "someone1337",
     "homepage": "https://git.somenet.org/factorio/RealisticDecorationCleanup.git",
-- 
2.43.0