Lumbridge npcs have some bad compositions and return null in the dev tools.

This commit is contained in:
Levi Schuck
2018-04-08 15:05:45 -05:00
committed by Adam
parent fed264989f
commit d184a908f7

View File

@@ -154,21 +154,27 @@ public class DevToolsOverlay extends Overlay
for (NPC npc : npcs) for (NPC npc : npcs)
{ {
NPCComposition composition = npc.getComposition(); NPCComposition composition = npc.getComposition();
Color color = composition.getCombatLevel() > 1 ? YELLOW : ORANGE;
if (composition.getConfigs() != null) if (composition.getConfigs() != null)
{ {
composition = composition.transform(); NPCComposition transformedComposition = composition.transform();
if (transformedComposition == null)
{
color = GRAY;
}
else
{
composition = transformedComposition;
}
} }
String text = composition.getName() + " (ID: " + composition.getId() + ") (A: " + npc.getAnimation() String text = String.format("%s (ID: %d) (A: %d) (G: %d)",
+ ") (G: " + npc.getGraphic() + ")"; composition.getName(),
if (npc.getCombatLevel() > 1) composition.getId(),
{ npc.getAnimation(),
OverlayUtil.renderActorOverlay(graphics, npc, text, YELLOW); npc.getGraphic());
}
else OverlayUtil.renderActorOverlay(graphics, npc, text, color);
{
OverlayUtil.renderActorOverlay(graphics, npc, text, ORANGE);
}
} }
} }