From 77b0fc4eb6c073a595dc66bf14a97c14c0d795d3 Mon Sep 17 00:00:00 2001 From: Ceikry Date: Wed, 24 Aug 2022 23:15:01 +0000 Subject: [PATCH] Fixed a bug with usewith listeners where the ids could be flipped in inappropriate contexts --- .../kotlin/rs09/game/interaction/InteractionListeners.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Server/src/main/kotlin/rs09/game/interaction/InteractionListeners.kt b/Server/src/main/kotlin/rs09/game/interaction/InteractionListeners.kt index c29582fed..ac75ff28c 100644 --- a/Server/src/main/kotlin/rs09/game/interaction/InteractionListeners.kt +++ b/Server/src/main/kotlin/rs09/game/interaction/InteractionListeners.kt @@ -171,7 +171,10 @@ object InteractionListeners { var flipped = false val method = if (with is Player) get(-1, used.id, 4) ?: return false - else get(used.id,with.id,type) ?: get(with.id,used.id,type).also { flipped = true } ?: return false + else get(used.id,with.id,type) ?: + if (type == InteractionListener.ITEM) + get(with.id,used.id,type).also { flipped = true } ?: return false + else return false val destOverride = if(flipped) { getOverride(type, used.id, "use") ?: getOverride(type, with.id) ?: getOverride(type, "use")