Fix #417 handle invalid alternative condition

This commit is contained in:
Misode
2023-10-03 11:12:23 +02:00
parent 446025cdec
commit 6074a15d61

View File

@@ -397,6 +397,7 @@ function testCondition(condition: any, ctx: LootContext): boolean {
const LootConditions: Record<string, (params: any) => LootCondition> = {
alternative: ({ terms }) => (ctx) => {
if (!Array.isArray(terms) || terms.length === 0) return true
for (const term of terms) {
if (testCondition(term, ctx)) {
return true