Merge pull request #1331 from LeviSchuck/npc-nullpointer

Lumbridge npcs have some bad compositions and return null
This commit is contained in:
Adam
2018-04-08 17:35:03 -04:00
committed by GitHub

View File

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