From fd583cf2b9acafd38d323a5d042dcfb4dc252a70 Mon Sep 17 00:00:00 2001
From: DBotThePony <dbotthepony@yandex.ru>
Date: Mon, 22 Apr 2024 22:22:01 +0700
Subject: [PATCH] Fix smashOnBreak not being honored

---
 .../dbotthepony/kstarbound/world/entities/tile/WorldObject.kt   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/world/entities/tile/WorldObject.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/world/entities/tile/WorldObject.kt
index ffb4b3ba..b270575b 100644
--- a/src/main/kotlin/ru/dbotthepony/kstarbound/world/entities/tile/WorldObject.kt
+++ b/src/main/kotlin/ru/dbotthepony/kstarbound/world/entities/tile/WorldObject.kt
@@ -628,7 +628,7 @@ open class WorldObject(val config: Registry.Entry<ObjectDefinition>) : TileEntit
 	override fun onRemove(world: World<*, *>, reason: RemovalReason) {
 		super.onRemove(world, reason)
 
-		val doSmash = health <= 0.0
+		val doSmash = health <= 0.0 || lookupProperty("smashOnBreak") { JsonPrimitive(config.value.smashOnBreak) }.asBoolean
 
 		fun spawnRandomItems(poolName: String, optionsName: String, seedName: String): Boolean {
 			val dropPool = lookupProperty(poolName) { JsonPrimitive("") }.asString