diff --git a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpFisherman.kt b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpFisherman.kt index 6804ebe92..4974a9d6d 100644 --- a/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpFisherman.kt +++ b/Common/src/main/java/at/petrak/hexcasting/common/casting/operators/stack/OpFisherman.kt @@ -13,9 +13,14 @@ import kotlin.math.abs import kotlin.math.roundToInt object OpFisherman : Operator { - override fun operate(continuation: SpellContinuation, stack: MutableList>, local: SpellDatum<*>, ctx: CastingContext): OperationResult { - if (stack.isEmpty()) - throw MishapNotEnoughArgs(1, 0) + override fun operate( + continuation: SpellContinuation, + stack: MutableList>, + local: SpellDatum<*>, + ctx: CastingContext + ): OperationResult { + if (stack.size < 2) + throw MishapNotEnoughArgs(2, 0) val arg = stack.getChecked(stack.lastIndex) val datum = stack[stack.lastIndex] val distance = stack.size - (arg + 1) // because getChecked just gives me a double for some reason