File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Common/src/main/java/at/petrak/hexcasting/api/casting/castables Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -28,15 +28,16 @@ interface ConstMediaAction : Action {
2828 override fun operate (env : CastingEnvironment , image : CastingImage , continuation : SpellContinuation ): OperationResult {
2929 val stack = image.stack.toMutableList()
3030
31- if (env.extractMedia(this .mediaCost, true ) > 0 )
32- throw MishapNotEnoughMedia (this .mediaCost)
3331 if (this .argc > stack.size)
3432 throw MishapNotEnoughArgs (this .argc, stack.size)
3533 val args = stack.takeLast(this .argc)
3634 repeat(this .argc) { stack.removeLast() }
3735 val result = this .executeWithOpCount(args, env)
3836 stack.addAll(result.resultStack)
3937
38+ if (env.extractMedia(this .mediaCost, true ) > 0 )
39+ throw MishapNotEnoughMedia (this .mediaCost)
40+
4041 val sideEffects = mutableListOf<OperatorSideEffect >(OperatorSideEffect .ConsumeMedia (this .mediaCost))
4142
4243 val image2 = image.copy(stack = stack, opsConsumed = image.opsConsumed + result.opCount)
You can’t perform that action at this time.
0 commit comments