Fixed total coins
This commit is contained in:
@@ -70,7 +70,7 @@ export function getCoinMultiplier(level: number, rank?: string, specialRank?: st
|
||||
const coinsSchema = z.record(
|
||||
z.string(),
|
||||
z.object({
|
||||
coins: z.number().optional()
|
||||
coins: z.number().default(0)
|
||||
})
|
||||
)
|
||||
|
||||
@@ -83,7 +83,9 @@ export function getTotalCoins(stats: Player["player"]["stats"]) {
|
||||
|
||||
if (!data) return 0
|
||||
|
||||
return Object.values(data).reduce((total, stat) => total + (stat.coins || 0), 0)
|
||||
console.log(data)
|
||||
|
||||
return Object.values(data).reduce((total, stat) => total + stat.coins, 0)
|
||||
}
|
||||
|
||||
export function getTotalQuests(quests: Player["player"]["quests"]) {
|
||||
|
||||
@@ -913,6 +913,7 @@ function arcadeModeWins() {
|
||||
}
|
||||
|
||||
export const arcadeStatsSchema = z.object({
|
||||
coins: z.number().default(0),
|
||||
pixel_party: z.object({
|
||||
wins: z.number().default(0)
|
||||
}).optional(),
|
||||
|
||||
Reference in New Issue
Block a user