This commit is contained in:
gamma-delta 2022-03-24 14:13:56 -05:00
parent e72b764534
commit 7765baf98c

View file

@ -81,13 +81,6 @@ data class CastingContext(
} }
fun isVecInRange(vec: Vec3): Boolean { fun isVecInRange(vec: Vec3): Boolean {
if (this.spellCircle != null) {
return this.spellCircle.aabb.contains(vec)
}
if (vec.distanceToSqr(this.caster.position()) < Operator.MAX_DISTANCE * Operator.MAX_DISTANCE)
return true
val maybeSentinel = this.caster.getCapability(HexCapabilities.SENTINEL).resolve() val maybeSentinel = this.caster.getCapability(HexCapabilities.SENTINEL).resolve()
if (maybeSentinel.isPresent) { if (maybeSentinel.isPresent) {
val sentinel = maybeSentinel.get() val sentinel = maybeSentinel.get()
@ -98,6 +91,13 @@ data class CastingContext(
return true return true
} }
if (this.spellCircle != null) {
return this.spellCircle.aabb.contains(vec)
}
if (vec.distanceToSqr(this.caster.position()) < Operator.MAX_DISTANCE * Operator.MAX_DISTANCE)
return true
return false return false
} }