diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/OpAddMotion.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/OpAddMotion.kt index 7f45168f85..292f404eba 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/OpAddMotion.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/actions/spells/OpAddMotion.kt @@ -29,14 +29,15 @@ object OpAddMotion : SpellAction { val motion = args.getVec3(1, argc) env.assertEntityInRange(target) - var motionForCost = motion.lengthSqr() - if (CastingImage.checkAndMarkGivenMotion(userData, target)) - motionForCost++ - val shrunkMotion = if (motion.lengthSqr() > MAX_MOTION * MAX_MOTION) motion.normalize().scale(MAX_MOTION) else motion + + var motionForCost = shrunkMotion.lengthSqr() + if (CastingImage.checkAndMarkGivenMotion(userData, target)) + motionForCost++ + return SpellAction.Result( Spell(target, shrunkMotion), (motionForCost * MediaConstants.DUST_UNIT).toLong(),