diff --git a/public/src/js/songselect.js b/public/src/js/songselect.js index eb547a8..d2004c0 100644 --- a/public/src/js/songselect.js +++ b/public/src/js/songselect.js @@ -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) } + }