Fix: Only allow leaderboard for server songs with numeric IDs
This commit is contained in:
@@ -3335,7 +3335,11 @@ class SongSelect {
|
||||
});
|
||||
}
|
||||
toLeaderboard() {
|
||||
if (!this.songs[this.selectedSong].id) {
|
||||
var songId = this.songs[this.selectedSong].id
|
||||
// Only allow leaderboard for server songs with numeric IDs
|
||||
if (!songId || typeof songId !== 'number' || isNaN(songId)) {
|
||||
// Show alert for custom/local songs
|
||||
alert("排行榜仅支持服务器歌曲\nLeaderboard only available for server songs")
|
||||
return
|
||||
}
|
||||
// Default to first available difficulty if not in a valid difficulty selection
|
||||
@@ -3347,6 +3351,7 @@ class SongSelect {
|
||||
|
||||
this.clean()
|
||||
this.playSound("se_don")
|
||||
new Leaderboard().display(this.songs[this.selectedSong].id, diffId)
|
||||
new Leaderboard().display(songId, diffId)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user