runelite-client: remove various redundant null checks
This commit is contained in:
@@ -252,10 +252,6 @@ public class SceneOverlay extends Overlay
|
|||||||
lp = new LocalPoint(
|
lp = new LocalPoint(
|
||||||
lp.getX() + dx * Perspective.LOCAL_TILE_SIZE + dx * Perspective.LOCAL_TILE_SIZE * (area.getWidth() - 1) / 2,
|
lp.getX() + dx * Perspective.LOCAL_TILE_SIZE + dx * Perspective.LOCAL_TILE_SIZE * (area.getWidth() - 1) / 2,
|
||||||
lp.getY() + dy * Perspective.LOCAL_TILE_SIZE + dy * Perspective.LOCAL_TILE_SIZE * (area.getHeight() - 1) / 2);
|
lp.getY() + dy * Perspective.LOCAL_TILE_SIZE + dy * Perspective.LOCAL_TILE_SIZE * (area.getHeight() - 1) / 2);
|
||||||
if (lp == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Polygon poly = Perspective.getCanvasTilePoly(client, lp);
|
Polygon poly = Perspective.getCanvasTilePoly(client, lp);
|
||||||
if (poly == null)
|
if (poly == null)
|
||||||
@@ -313,10 +309,6 @@ public class SceneOverlay extends Overlay
|
|||||||
private void renderTileIfHasLineOfSight(Graphics2D graphics, WorldArea start, int targetX, int targetY)
|
private void renderTileIfHasLineOfSight(Graphics2D graphics, WorldArea start, int targetX, int targetY)
|
||||||
{
|
{
|
||||||
WorldPoint targetLocation = new WorldPoint(targetX, targetY, start.getPlane());
|
WorldPoint targetLocation = new WorldPoint(targetX, targetY, start.getPlane());
|
||||||
if (targetLocation == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Running the line of sight algorithm 100 times per frame doesn't
|
// Running the line of sight algorithm 100 times per frame doesn't
|
||||||
// seem to use much CPU time, however rendering 100 tiles does
|
// seem to use much CPU time, however rendering 100 tiles does
|
||||||
|
|||||||
@@ -172,11 +172,6 @@ class InstanceMapOverlay extends Overlay
|
|||||||
drawPlayerDot(graphics, client.getLocalPlayer(), Color.white, Color.black);
|
drawPlayerDot(graphics, client.getLocalPlayer(), Color.white, Color.black);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (image == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Dimension(image.getWidth(), image.getHeight());
|
return new Dimension(image.getWidth(), image.getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,11 +86,6 @@ public class KourendLibraryOverlay extends Overlay
|
|||||||
|
|
||||||
List<Bookcase> allBookcases = library.getBookcasesOnLevel(client.getPlane());
|
List<Bookcase> allBookcases = library.getBookcasesOnLevel(client.getPlane());
|
||||||
|
|
||||||
if (allBookcases == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Bookcase bookcase : allBookcases)
|
for (Bookcase bookcase : allBookcases)
|
||||||
{
|
{
|
||||||
// AABB
|
// AABB
|
||||||
|
|||||||
@@ -47,11 +47,6 @@ public class IDAStar extends Pathfinder
|
|||||||
{
|
{
|
||||||
PuzzleState goalNode = path(root);
|
PuzzleState goalNode = path(root);
|
||||||
|
|
||||||
if (goalNode == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<PuzzleState> path = new ArrayList<>();
|
List<PuzzleState> path = new ArrayList<>();
|
||||||
|
|
||||||
PuzzleState parent = goalNode;
|
PuzzleState parent = goalNode;
|
||||||
|
|||||||
Reference in New Issue
Block a user