mirror of
https://github.com/asphyxia-core/plugins.git
synced 2026-09-22 22:27:56 +03:00
All: Send 0 if clear_type is not existing.
This commit is contained in:
@@ -169,7 +169,7 @@ const getScores = async (refid: string, forFriend: boolean = false) => {
|
|||||||
900: 9,
|
900: 9,
|
||||||
1000: 10,
|
1000: 10,
|
||||||
1100: 11,
|
1100: 11,
|
||||||
}[score.clear_type];
|
}[score.clear_type] || 0;
|
||||||
|
|
||||||
if (music > GAME_MAX_MUSIC_ID) {
|
if (music > GAME_MAX_MUSIC_ID) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ const getScores = async (refid: string) => {
|
|||||||
900: 10,
|
900: 10,
|
||||||
1000: 11,
|
1000: 11,
|
||||||
1100: 15,
|
1100: 15,
|
||||||
}[score.clear_type];
|
}[score.clear_type] || 0;
|
||||||
clear_medal[music] = clear_medal[music] | (medal << (sheet * 4));
|
clear_medal[music] = clear_medal[music] | (medal << (sheet * 4));
|
||||||
|
|
||||||
const hiscore_index = (music * 4) + sheet;
|
const hiscore_index = (music * 4) + sheet;
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ const getProfile = async (refid: string, name?: string) => {
|
|||||||
900: 9,
|
900: 9,
|
||||||
1000: 10,
|
1000: 10,
|
||||||
1100: 11,
|
1100: 11,
|
||||||
}[score.clear_type]),
|
}[score.clear_type] || 0),
|
||||||
old_score: K.ITEM('s32', 0),
|
old_score: K.ITEM('s32', 0),
|
||||||
old_clear_type: K.ITEM('u8', 0),
|
old_clear_type: K.ITEM('u8', 0),
|
||||||
});
|
});
|
||||||
@@ -416,7 +416,7 @@ const friend = async (req: EamuseInfo, data: any, send: EamuseSend): Promise<any
|
|||||||
music_num: music.toString(),
|
music_num: music.toString(),
|
||||||
sheet_num: sheet.toString(),
|
sheet_num: sheet.toString(),
|
||||||
score: score.score.toString(),
|
score: score.score.toString(),
|
||||||
clearmedal: {
|
clearmedal: ({
|
||||||
100: 1,
|
100: 1,
|
||||||
200: 2,
|
200: 2,
|
||||||
300: 3,
|
300: 3,
|
||||||
@@ -428,7 +428,7 @@ const friend = async (req: EamuseInfo, data: any, send: EamuseSend): Promise<any
|
|||||||
900: 9,
|
900: 9,
|
||||||
1000: 10,
|
1000: 10,
|
||||||
1100: 11,
|
1100: 11,
|
||||||
}[score.clear_type].toString(),
|
}[score.clear_type] || 0).toString(),
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -302,7 +302,7 @@ const getScores = async (refid: string) => {
|
|||||||
900: 10,
|
900: 10,
|
||||||
1000: 11,
|
1000: 11,
|
||||||
1100: 15,
|
1100: 15,
|
||||||
}[score.clear_type];
|
}[score.clear_type] || 0;
|
||||||
clear_medal[music] = clear_medal[music] | (medal << (sheet * 4));
|
clear_medal[music] = clear_medal[music] | (medal << (sheet * 4));
|
||||||
|
|
||||||
const hiscore_index = (music * 4) + sheet;
|
const hiscore_index = (music * 4) + sheet;
|
||||||
|
|||||||
@@ -397,7 +397,7 @@ const __format_flags_for_score = (sheet: number, clear_type: number) => {
|
|||||||
3: 0x4000,
|
3: 0x4000,
|
||||||
7: 0,
|
7: 0,
|
||||||
8: 0,
|
8: 0,
|
||||||
}[sheet]
|
}[sheet];
|
||||||
const shift = {
|
const shift = {
|
||||||
9: 4,
|
9: 4,
|
||||||
4: 0,
|
4: 0,
|
||||||
@@ -408,7 +408,7 @@ const __format_flags_for_score = (sheet: number, clear_type: number) => {
|
|||||||
3: 6,
|
3: 6,
|
||||||
7: 9,
|
7: 9,
|
||||||
8: 8,
|
8: 8,
|
||||||
}[sheet]
|
}[sheet];
|
||||||
const flags = {
|
const flags = {
|
||||||
100: 0,
|
100: 0,
|
||||||
200: 0,
|
200: 0,
|
||||||
@@ -421,7 +421,7 @@ const __format_flags_for_score = (sheet: number, clear_type: number) => {
|
|||||||
900: 2,
|
900: 2,
|
||||||
1000: 2,
|
1000: 2,
|
||||||
1100: 3,
|
1100: 3,
|
||||||
}[clear_type]
|
}[clear_type] || 0;
|
||||||
return (flags << shift) | playedflag
|
return (flags << shift) | playedflag
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -185,7 +185,7 @@ const getScores = async (refid: string, version: string, forFriend: boolean = fa
|
|||||||
900: 9,
|
900: 9,
|
||||||
1000: 10,
|
1000: 10,
|
||||||
1100: 11,
|
1100: 11,
|
||||||
}[score.clear_type];
|
}[score.clear_type] || 0;
|
||||||
|
|
||||||
if (music > maxMusicId) {
|
if (music > maxMusicId) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user