From 58ec1b793355a7d19db52d73bb4ccc90bb666e18 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 22 Apr 2024 20:48:19 +0700 Subject: [PATCH] Fix hitting only rooted tile did not break trees --- .../ru/dbotthepony/kstarbound/server/world/ServerWorld.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/kstarbound/server/world/ServerWorld.kt b/src/main/kotlin/ru/dbotthepony/kstarbound/server/world/ServerWorld.kt index cb51ba15..e6282747 100644 --- a/src/main/kotlin/ru/dbotthepony/kstarbound/server/world/ServerWorld.kt +++ b/src/main/kotlin/ru/dbotthepony/kstarbound/server/world/ServerWorld.kt @@ -196,7 +196,10 @@ class ServerWorld private constructor( for ((pos, chunk, roots) in actualPositions) { for (root in roots) { - toDamageEntities.computeIfAbsent(root, Object2ObjectFunction { ObjectArraySet() }).add(pos) + val posList = toDamageEntities.computeIfAbsent(root, Object2ObjectFunction { ObjectArraySet() }) + posList.add(pos) + posList.addAll(root.roots) + posList.add(root.tilePosition) } if (!isBackground) {