try to fix weird score bug

controller only gets re-assigned on first boot
don't stall the cpu to queue frames
This commit is contained in:
minenice55
2024-01-16 15:21:22 -05:00
parent 7f15ce82c1
commit b6ec60ca92
5 changed files with 22 additions and 21 deletions

View File

@ -134,6 +134,21 @@ namespace HeavenStudio
barSlider.fillRect.GetComponent<Image>().color = barColourNg;
string propSuffix = "ng";
double inputs = 0, score = 0;
foreach (var input in judgementInfo.inputs)
{
inputs += input.weight;
score += Math.Clamp(input.accuracyState, 0, 1) * input.weight;
}
if (inputs > 0)
{
score /= inputs;
}
else
{
score = 0;
}
judgementInfo.finalScore = score;
if (judgementInfo.finalScore < Minigame.rankOkThreshold)
{
rank = Rank.Ng;