From db05e61c6e2550ee618ed4f339c800db534c60b6 Mon Sep 17 00:00:00 2001
From: Someone <someone@somenet.org>
Date: Fri, 1 Mar 2019 03:32:01 +0100
Subject: [PATCH] Fixed that all decorations everywhere were removed, instead
 of only the few that were built on.

---
 changelog.txt |  7 +++++++
 control.lua   |  4 ++--
 info.json     | 20 ++++++++++----------
 3 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/changelog.txt b/changelog.txt
index 1ab66c6..2d4ccfb 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,3 +1,10 @@
+---------------------------------------------------------------------------------------------------
+Version: 0.17.2
+Date: 2019-03-01
+
+  Changed:
+    - Bad testing was bad. Should work correctly now. Thanks to TheBB
+
 ---------------------------------------------------------------------------------------------------
 Version: 0.17.1
 Date: 2019-02-27
diff --git a/control.lua b/control.lua
index 80397e9..760540a 100644
--- a/control.lua
+++ b/control.lua
@@ -1,12 +1,12 @@
 --[[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
-		game.surfaces[1].destroy_decoratives(event.created_entity.bounding_box)
+		game.surfaces[1].destroy_decoratives{area=event.created_entity.bounding_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
-		game.surfaces[1].destroy_decoratives(event.created_entity.bounding_box)
+		game.surfaces[1].destroy_decoratives{area=event.created_entity.bounding_box}
 	end
 end)
diff --git a/info.json b/info.json
index a046db4..aaa40c3 100644
--- a/info.json
+++ b/info.json
@@ -1,10 +1,10 @@
-{
-    "name": "RealisticDecorationCleanup",
-    "version": "0.17.1",
-    "title": "Realistic Decoration Cleanup",
-    "author": "someone1337",
-    "homepage": "https://git.somenet.org/pub/jan/factorio_RealisticDecorationCleanup.git",
-    "description": "Remove decorations prior to placing entities or tiles. Normally you would not build a house/road and leave the bushes below it.",
-    "dependencies": ["base"],
-    "factorio_version": "0.17"
-}
+{
+    "name": "RealisticDecorationCleanup",
+    "version": "0.17.2",
+    "title": "Realistic Decoration Cleanup",
+    "author": "someone1337",
+    "homepage": "https://git.somenet.org/pub/jan/factorio_RealisticDecorationCleanup.git",
+    "description": "Remove decorations prior to placing entities or tiles. Normally you would not build a house/road and leave the bushes below it.",
+    "dependencies": ["base"],
+    "factorio_version": "0.17"
+}
-- 
2.43.0