Fixed bug with mw
This commit is contained in:
@@ -53,8 +53,8 @@ export function megaWalsClassStats(classId: typeof CLASSES[number]["id"], stats:
|
|||||||
stats[`${classId}_wins`],
|
stats[`${classId}_wins`],
|
||||||
stats[`${classId}_losses`],
|
stats[`${classId}_losses`],
|
||||||
devide(stats[`${classId}_wins`], stats[`${classId}_deaths`]),
|
devide(stats[`${classId}_wins`], stats[`${classId}_deaths`]),
|
||||||
stats.classes === undefined ? 0 : stats.classes[classId].prestige,
|
stats.classes?.[classId]?.prestige || 0,
|
||||||
stats.classes === undefined ? 0 : stats.classes[classId].enderchest_rows
|
stats.classes?.[classId]?.enderchest_rows || 0
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -600,14 +600,17 @@ function megawallsClassStats() {
|
|||||||
] as const
|
] as const
|
||||||
|
|
||||||
const entries = new Map<string, z.ZodDefault<z.ZodNumber>>()
|
const entries = new Map<string, z.ZodDefault<z.ZodNumber>>()
|
||||||
const classes = new Map<string, z.ZodObject<{ prestige: z.ZodDefault<z.ZodNumber>, enderchest_rows: z.ZodDefault<z.ZodNumber> }, z.core.$loose>>()
|
const classes = new Map<
|
||||||
|
string,
|
||||||
|
z.ZodOptional<z.ZodObject<{ prestige: z.ZodDefault<z.ZodNumber>, enderchest_rows: z.ZodDefault<z.ZodNumber> }, z.core.$loose>>
|
||||||
|
>()
|
||||||
|
|
||||||
for (const id of ids) {
|
for (const id of ids) {
|
||||||
for (const stat of stats) {
|
for (const stat of stats) {
|
||||||
entries.set(`${id}_${stat}`, z.number().default(0))
|
entries.set(`${id}_${stat}`, z.number().default(0))
|
||||||
}
|
}
|
||||||
for (const klass of classesOther) {
|
for (const klass of classesOther) {
|
||||||
classes.set(id, z.looseObject({ prestige: z.number().default(0), enderchest_rows: z.number().default(0) }))
|
classes.set(id, z.looseObject({ prestige: z.number().default(0), enderchest_rows: z.number().default(0) }).optional())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -615,7 +618,7 @@ function megawallsClassStats() {
|
|||||||
classStats: Object.fromEntries(entries) as Record<`${typeof ids[number]}_${typeof stats[number]}`, z.ZodDefault<z.ZodNumber>>,
|
classStats: Object.fromEntries(entries) as Record<`${typeof ids[number]}_${typeof stats[number]}`, z.ZodDefault<z.ZodNumber>>,
|
||||||
classOther: Object.fromEntries(classes) as Record<
|
classOther: Object.fromEntries(classes) as Record<
|
||||||
`${typeof ids[number]}`,
|
`${typeof ids[number]}`,
|
||||||
z.ZodObject<{ prestige: z.ZodDefault<z.ZodNumber>, enderchest_rows: z.ZodDefault<z.ZodNumber> }, z.core.$loose>
|
z.ZodOptional<z.ZodObject<{ prestige: z.ZodDefault<z.ZodNumber>, enderchest_rows: z.ZodDefault<z.ZodNumber> }, z.core.$loose>>
|
||||||
>
|
>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user