Skip to content

Commit

Permalink
npc indicators: Use isDying for dead NPC checks (runelite#15160)
Browse files Browse the repository at this point in the history
  • Loading branch information
LlemonDuck authored Jul 1, 2022
1 parent 65e9026 commit 63361dc
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import net.runelite.client.config.ConfigManager;
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.events.ConfigChanged;
import net.runelite.client.game.NpcUtil;
import net.runelite.client.game.npcoverlay.HighlightedNpc;
import net.runelite.client.game.npcoverlay.NpcOverlayService;
import net.runelite.client.plugins.Plugin;
Expand Down Expand Up @@ -276,12 +277,12 @@ public void onMenuEntryAdded(MenuEntryAdded event)
else
{
Color color = null;
if (npc.isDead())
if (NpcUtil.isDying(npc))
{
color = config.deadNpcMenuColor();
}

if (color == null && highlightedNpcs.containsKey(npc) && config.highlightMenuNames() && (!npc.isDead() || !config.ignoreDeadNpcs()))
if (color == null && highlightedNpcs.containsKey(npc) && config.highlightMenuNames() && (!NpcUtil.isDying(npc) || !config.ignoreDeadNpcs()))
{
color = config.highlightColor();
}
Expand Down Expand Up @@ -668,7 +669,7 @@ private HighlightedNpc highlightedNpc(NPC npc)
.nameOnMinimap(config.drawMinimapNames())
.borderWidth((float) config.borderWidth())
.outlineFeather(config.outlineFeather())
.render(n -> !n.isDead() || !config.ignoreDeadNpcs())
.render(n -> !NpcUtil.isDying(n) || !config.ignoreDeadNpcs())
.build();
}
}

0 comments on commit 63361dc

Please sign in to comment.