Lumbridge npcs have some bad compositions and return null in the dev tools.
This commit is contained in:
@@ -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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user