Skip to content

Commit

Permalink
fix npc changed event
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatGamerBlue committed Feb 14, 2021
1 parent 49973ad commit d1e027c
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,18 @@ public void onDefinitionChanged(RSNPCComposition composition)
}
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));
}
}

Expand Down

0 comments on commit d1e027c

Please sign in to comment.