Merge pull request #1949 from Abextm/tithe-npe
TitheFarmPlugin: Fix null pointer when crops near camera
This commit is contained in:
@@ -64,8 +64,12 @@ public class TitheFarmPlantOverlay extends Overlay
|
|||||||
for (TitheFarmPlant plant : plugin.getPlants())
|
for (TitheFarmPlant plant : plugin.getPlants())
|
||||||
{
|
{
|
||||||
LocalPoint localLocation = LocalPoint.fromWorld(client, plant.getWorldLocation());
|
LocalPoint localLocation = LocalPoint.fromWorld(client, plant.getWorldLocation());
|
||||||
|
if (localLocation == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
net.runelite.api.Point canvasLocation = Perspective.worldToCanvas(client, localLocation.getX(), localLocation.getY(), client.getPlane());
|
net.runelite.api.Point canvasLocation = Perspective.worldToCanvas(client, localLocation.getX(), localLocation.getY(), client.getPlane());
|
||||||
if (viewport != null && localLocation != null)
|
if (viewport != null && canvasLocation != null)
|
||||||
{
|
{
|
||||||
switch (plant.getState())
|
switch (plant.getState())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user