Merge pull request #7502 from deathbeam/skip-out-of-scene
Null-check local location in trap overlay
This commit is contained in:
@@ -79,6 +79,7 @@ public class Perspective
|
|||||||
* @return a {@link Point} on screen corresponding to the position in
|
* @return a {@link Point} on screen corresponding to the position in
|
||||||
* 3D-space
|
* 3D-space
|
||||||
*/
|
*/
|
||||||
|
@Nullable
|
||||||
public static Point localToCanvas(@Nonnull Client client, @Nonnull LocalPoint point, int plane)
|
public static Point localToCanvas(@Nonnull Client client, @Nonnull LocalPoint point, int plane)
|
||||||
{
|
{
|
||||||
return localToCanvas(client, point, plane, 0);
|
return localToCanvas(client, point, plane, 0);
|
||||||
@@ -95,6 +96,7 @@ public class Perspective
|
|||||||
* @return a {@link Point} on screen corresponding to the position in
|
* @return a {@link Point} on screen corresponding to the position in
|
||||||
* 3D-space
|
* 3D-space
|
||||||
*/
|
*/
|
||||||
|
@Nullable
|
||||||
public static Point localToCanvas(@Nonnull Client client, @Nonnull LocalPoint point, int plane, int zOffset)
|
public static Point localToCanvas(@Nonnull Client client, @Nonnull LocalPoint point, int plane, int zOffset)
|
||||||
{
|
{
|
||||||
final int tileHeight = getTileHeight(client, point, plane);
|
final int tileHeight = getTileHeight(client, point, plane);
|
||||||
|
|||||||
@@ -143,6 +143,11 @@ public class TrapOverlay extends Overlay
|
|||||||
}
|
}
|
||||||
net.runelite.api.Point loc = Perspective.localToCanvas(client, localLoc, client.getPlane());
|
net.runelite.api.Point loc = Perspective.localToCanvas(client, localLoc, client.getPlane());
|
||||||
|
|
||||||
|
if (loc == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
double timeLeft = 1 - trap.getTrapTimeRelative();
|
double timeLeft = 1 - trap.getTrapTimeRelative();
|
||||||
|
|
||||||
ProgressPieComponent pie = new ProgressPieComponent();
|
ProgressPieComponent pie = new ProgressPieComponent();
|
||||||
|
|||||||
Reference in New Issue
Block a user