Reinstate missing null check in SpellRay, fixes part of #519
This commit is contained in:
@@ -178,6 +178,8 @@ public abstract class SpellRay extends Spell {
|
|||||||
Vec3d origin = new Vec3d(caster.posX, caster.posY + caster.getEyeHeight() - Y_OFFSET, caster.posZ);
|
Vec3d origin = new Vec3d(caster.posX, caster.posY + caster.getEyeHeight() - Y_OFFSET, caster.posZ);
|
||||||
Vec3d targetPos = null;
|
Vec3d targetPos = null;
|
||||||
|
|
||||||
|
if(target != null){
|
||||||
|
|
||||||
if(!ignoreLivingEntities || !EntityUtils.isLiving(target)){
|
if(!ignoreLivingEntities || !EntityUtils.isLiving(target)){
|
||||||
targetPos = new Vec3d(target.posX, target.posY + target.height / 2, target.posZ);
|
targetPos = new Vec3d(target.posX, target.posY + target.height / 2, target.posZ);
|
||||||
|
|
||||||
@@ -194,6 +196,7 @@ public abstract class SpellRay extends Spell {
|
|||||||
targetPos = new Vec3d(x + 0.5, y + 1, z + 0.5);
|
targetPos = new Vec3d(x + 0.5, y + 1, z + 0.5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(targetPos == null) return false; // If there was nothing to aim at (e.g. snare when the target is in the air)
|
if(targetPos == null) return false; // If there was nothing to aim at (e.g. snare when the target is in the air)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user