fix for trading npcs behind booths/etc

This commit is contained in:
ceikry
2021-06-28 15:48:35 -05:00
parent cef1f1d8eb
commit 33e5f85d81
@@ -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
}
}
}