fix two arguments incorrectly being inclusive

This commit is contained in:
yrsegal@gmail.com 2022-11-09 19:53:40 -05:00
parent 61e292af10
commit 9730a252f2
2 changed files with 2 additions and 2 deletions

View file

@ -8,7 +8,7 @@ object OpModifyInPlace : ConstMediaAction {
override val argc = 3
override fun execute(args: List<Iota>, ctx: CastingContext): List<Iota> {
val list = args.getList(0, argc)
val index = args.getPositiveIntUnderInclusive(1, list.size(), argc)
val index = args.getPositiveIntUnder(1, list.size(), argc)
val iota = args[2]
return list.modifyAt(index) { SpellList.LPair(iota, it.cdr) }.asActionResult
}

View file

@ -17,7 +17,7 @@ object OpBeep : SpellAction {
ctx: CastingContext
): Triple<RenderedSpell, Int, List<ParticleSpray>> {
val target = args.getVec3(0, argc)
val instrument = args.getPositiveIntUnderInclusive(1, NoteBlockInstrument.values().size, argc)
val instrument = args.getPositiveIntUnder(1, NoteBlockInstrument.values().size, argc)
val note = args.getPositiveIntUnderInclusive(2, 24, argc) // mojang don't have magic numbers challenge
ctx.assertVecInRange(target)