Skip to content
Permalink
Browse files

Fixed a crash caused by a hive with a null queen.

  • Loading branch information
Ri5ux committed Mar 25, 2020
1 parent 2804357 commit e9113298f4542a3085161c6948f525c49a26e87f
Showing with 18 additions and 3 deletions.
  1. +18 −3 src/main/java/org/avp/world/hives/XenomorphHive.java
@@ -239,7 +239,12 @@ public String toString()

public boolean isQueenAtCore()
{
return this.getQueen().getDistance(this.xCoord(), this.yCoord(), this.zCoord()) < this.getCoreRange();
if (this.getQueen() != null)
{
return this.getQueen().getDistance(this.xCoord(), this.yCoord(), this.zCoord()) < this.getCoreRange();
}

return false;
}

public boolean isPointWithinHive(Pos coord)
@@ -249,12 +254,22 @@ public boolean isPointWithinHive(Pos coord)

public boolean isPointWithinHive(int x, int y, int z)
{
return this.getQueen().getDistance(x, y, z) < this.getMaxHiveRadius();
if (this.getQueen() != null)
{
return this.getQueen().getDistance(x, y, z) < this.getMaxHiveRadius();
}

return false;
}

public double getDistanceFromHive(Entity entity)
{
return this.getQueen().getDistance(entity.posX, entity.posY, entity.posZ);
if (this.getQueen() != null)
{
return this.getQueen().getDistance(entity.posX, entity.posY, entity.posZ);
}

return 0;
}

public boolean isEntityWithinRange(Entity entity)

0 comments on commit e911329

Please sign in to comment.
You can’t perform that action at this time.