From d1e027c4cb2303b860e47c9caeb16496bf76a8f4 Mon Sep 17 00:00:00 2001 From: ThatGamerBlue Date: Sun, 14 Feb 2021 20:46:30 +0000 Subject: [PATCH] fix npc changed event --- .../main/java/net/runelite/mixins/RSNPCMixin.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSNPCMixin.java b/runelite-mixins/src/main/java/net/runelite/mixins/RSNPCMixin.java index 5d29390a45..c90105f7e4 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSNPCMixin.java +++ b/runelite-mixins/src/main/java/net/runelite/mixins/RSNPCMixin.java @@ -111,7 +111,18 @@ public abstract class RSNPCMixin implements RSNPC } else if (this.getId() != -1) { - client.getCallbacks().post(new NpcChanged(this, composition)); + RSNPCComposition oldComposition = getComposition(); + if (oldComposition == null) + { + return; + } + + if (composition.getId() == oldComposition.getId()) + { + return; + } + + client.getCallbacks().postDeferred(new NpcChanged(this, oldComposition)); } }