Fix bad report for packaging spell

This commit is contained in:
yrsegal@gmail.com 2022-04-29 17:13:07 -04:00
parent 9a0273688c
commit 7f90c76737

View file

@ -23,11 +23,13 @@ class OpMakePackagedSpell<T : ItemPackagedHex>(val itemType: T, val cost: Int) :
ctx: CastingContext
): Triple<RenderedSpell, Int, List<ParticleSpray>> {
val entity = args.getChecked<ItemEntity>(0)
val patterns = args.getChecked<List<SpellDatum<*>>>(1).map {
val patternsRaw = args.getChecked<List<SpellDatum<*>>>(1)
val patterns = patternsRaw.map {
if (it.payload is HexPattern)
it.payload
else
throw MishapInvalidIota(it, 0, TranslatableComponent("hexcasting.mishap.invalid_value.list.pattern"))
throw MishapInvalidIota(SpellDatum.make(patternsRaw), 0, TranslatableComponent("hexcasting.mishap.invalid_value.list.pattern"))
}
val (handStack, hand) = ctx.getHeldItemToOperateOn { it.`is`(itemType) }