From 33e5f85d81906cea33a4ab36d3dee1e8029afc89 Mon Sep 17 00:00:00 2001 From: ceikry Date: Mon, 28 Jun 2021 15:48:35 -0500 Subject: [PATCH] fix for trading npcs behind booths/etc --- .../java/core/game/interaction/npc/NPCTradePlugin.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Server/src/main/java/core/game/interaction/npc/NPCTradePlugin.kt b/Server/src/main/java/core/game/interaction/npc/NPCTradePlugin.kt index f2f3bb769..f867050d2 100644 --- a/Server/src/main/java/core/game/interaction/npc/NPCTradePlugin.kt +++ b/Server/src/main/java/core/game/interaction/npc/NPCTradePlugin.kt @@ -32,4 +32,16 @@ class NPCTradePlugin : InteractionListener() { return@on npc.openShop(player) } } + + override fun defineDestinationOverrides() { + setDest(NPC,"trade","shop"){node -> + val npc = node as NPC + if (npc.getAttribute("facing_booth", false)) { + val offsetX = npc.direction.stepX shl 1 + val offsetY = npc.direction.stepY shl 1 + return@setDest npc.location.transform(offsetX, offsetY, 0) + } + return@setDest node.location + } + } } \ No newline at end of file