idz: Fix backwards compatibility

Silently drop OOB course IDs instead of erroring. Those IDs may
come from later versions which have bigger arrays in that spot.
This commit is contained in:
Tau
2019-05-24 22:04:10 -04:00
parent 4d7a0d64a1
commit 98f6fb9d5b

View File

@@ -53,7 +53,7 @@ export function loadProfile2(res: LoadProfileResponse2) {
for (const [courseId, playCount] of res.coursePlays.entries()) {
if (courseId < 0 || courseId >= 16) {
throw new Error(`Course id out of range: ${courseId}`);
continue;
}
buf.writeUInt16LE(playCount, 0x0460 + 2 * courseId);