From d1e478b6efcd335e7ffff9453015fba323ff7866 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 29 Apr 2024 19:11:33 +0700 Subject: [PATCH] Fix interact action not specifying entity id when originating from Lua --- .../dbotthepony/kstarbound/world/entities/tile/WorldObject.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 6c729eeb..73e70ceb 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 @@ -541,11 +541,11 @@ open class WorldObject(val config: Registry.Entry) : TileEntit return InteractAction.NONE else if (result[0] is ByteString) { val decoded = (result[0] as ByteString).decode() - return InteractAction(InteractAction.Type.entries.firstOrNull { it.jsonName == decoded } ?: throw NoSuchElementException("Unknown interaction action type $decoded!")) + return InteractAction(InteractAction.Type.entries.firstOrNull { it.jsonName == decoded } ?: throw NoSuchElementException("Unknown interaction action type $decoded!"), entityID) } else { val data = result[0] as Table val decoded = (data[1L] as ByteString).decode() - return InteractAction(InteractAction.Type.entries.firstOrNull { it.jsonName == decoded } ?: throw NoSuchElementException("Unknown interaction action type $decoded!"), 0, toJsonFromLua(data[2L])) + return InteractAction(InteractAction.Type.entries.firstOrNull { it.jsonName == decoded } ?: throw NoSuchElementException("Unknown interaction action type $decoded!"), entityID, toJsonFromLua(data[2L])) } }