mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-12 01:08:29 +03:00
fix: don't reject entire imports if player has battle scores
This commit is contained in:
@@ -77,7 +77,11 @@ const PR_CG_POPN = {
|
||||
difficulty: p.isPositiveInteger,
|
||||
version: p.isPositiveInteger,
|
||||
clearFlag: p.isPositiveInteger,
|
||||
score: p.isBoundedInteger(0, 100_000),
|
||||
|
||||
// edge case. Score can go above 100k in battle mode.
|
||||
// although we don't support battle mode,
|
||||
// we cannot reject this in the parser - as it will cancel the entire import.
|
||||
score: p.isPositiveInteger,
|
||||
|
||||
coolCount: p.isPositiveInteger,
|
||||
greatCount: p.isPositiveInteger,
|
||||
|
||||
@@ -23,6 +23,10 @@ export const ConverterAPICGPopn: ConverterFunction<CGPopnScore, CGContext> = asy
|
||||
const difficulty = ConvertDifficulty(data.difficulty);
|
||||
const version = ConvertVersion(data.version);
|
||||
|
||||
if (data.score > 100_000) {
|
||||
throw new InvalidScoreFailure(`Score is > 100_000 (got ${data.score})`);
|
||||
}
|
||||
|
||||
const chart = await FindChartOnInGameIDVersion(
|
||||
"popn",
|
||||
data.internalId,
|
||||
|
||||
Reference in New Issue
Block a user