mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-03-30 22:35:04 +00:00
applySongRank fix
fixes the bug with the percent being overriden when the song has the same letter rank but lower percent (eg. E Rank with 99% being overriden by E Rank with 93%)
This commit is contained in:
parent
a27c4ae24f
commit
a4b59d14bf
|
@ -598,11 +598,15 @@ class Save
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//percent also accounts for different ranks
|
||||||
|
var oldPerc = (previousScoreData.tallies.sick + previousScoreData.tallies.good) / previousScoreData.tallies.totalNotes;
|
||||||
|
var newPerc = (newScoreData.tallies.sick + newScoreData.tallies.good) / newScoreData.tallies.totalNotes;
|
||||||
|
|
||||||
// Set the high score and the high rank separately.
|
// Set the high score and the high rank separately.
|
||||||
var newScore:SaveScoreData =
|
var newScore:SaveScoreData =
|
||||||
{
|
{
|
||||||
score: (previousScoreData.score > newScoreData.score) ? previousScoreData.score : newScoreData.score,
|
score: Std.int(Math.max(previousScoreData.score, newScoreData.score)),
|
||||||
tallies: (previousRank > newRank) ? previousScoreData.tallies : newScoreData.tallies
|
tallies: (oldPerc > newPerc ? previousScoreData.tallies : newScoreData.tallies)
|
||||||
};
|
};
|
||||||
|
|
||||||
song.set(difficultyId, newScore);
|
song.set(difficultyId, newScore);
|
||||||
|
|
Loading…
Reference in a new issue