mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-04 12:58:11 +03:00
Fix KAI returns -1 for No dan #488
This commit is contained in:
@@ -36,7 +36,7 @@ export async function CreateKaiSDVXClassHandler(
|
||||
|
||||
const sdvxDan: number | null = json.skill_level - 1;
|
||||
|
||||
if (sdvxDan === null) {
|
||||
if (sdvxDan === null || sdvxDan === undefined) {
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -52,6 +52,12 @@ export async function CreateKaiSDVXClassHandler(
|
||||
return {};
|
||||
}
|
||||
|
||||
// Kai APIs return -1 to indicate no dan. They also sometimes return undefined.
|
||||
// I'm not too sure why.
|
||||
if (sdvxDan === -1) {
|
||||
return {};
|
||||
}
|
||||
|
||||
if (sdvxDan < SDVXDans.DAN_1) {
|
||||
logger.warn(
|
||||
`${baseUrl} returned a dan of ${sdvxDan}, which was less than DAN_1 (${SDVXDans.DAN_1}.)`
|
||||
|
||||
Reference in New Issue
Block a user