Generally support decreasing scores. Prevents a bug when using score editor to lower the score

This commit is contained in:
Kiloku 2024-12-26 20:38:46 -03:00
parent b133f925e6
commit fbc101958b

View File

@ -5503,12 +5503,17 @@ void HUD_Score_Draw(f32 x, f32 y) {
f32 x1;
f32 y1;
f32 xScale;
bool decrease = false;
x = OTRGetDimensionFromLeftEdge(x);
if (gHitCount > gDisplayedHitCount) {
temp3 = gDisplayedHitCount + 1;
temp4 = gDisplayedHitCount;
} else if (gHitCount < gDisplayedHitCount) {
decrease = true;
temp3 = gDisplayedHitCount - 1;
temp4 = gDisplayedHitCount;
} else{
temp3 = gHitCount;
temp4 = gDisplayedHitCount;
@ -5519,6 +5524,7 @@ void HUD_Score_Draw(f32 x, f32 y) {
temp3 %= i;
temp4 %= i;
//Loop runs three times with i == 100, 10, and 1. For each digit of the score counter.
for (i /= 10, j = 0; i != 1; i /= 10, j++) {
xScale = 1.0f;
x1 = x;
@ -5592,7 +5598,11 @@ void HUD_Score_Draw(f32 x, f32 y) {
}
if (D_hud_80161720[j] >= 2.0f) {
if (decrease) {
temp4--;
} else {
temp4++;
}
if (temp4 >= 10) {
temp4 = 0;
}
@ -5600,7 +5610,11 @@ void HUD_Score_Draw(f32 x, f32 y) {
}
if ((D_hud_80161720[j] < 2.0f) && (D_hud_80161720[j] >= 1.1f)) {
if (decrease) {
temp4--;
} else {
temp4++;
}
if (temp4 >= 10) {
temp4 = 0;
}
@ -5617,7 +5631,11 @@ void HUD_Score_Draw(f32 x, f32 y) {
if ((gHitCount != gDisplayedHitCount) && (D_hud_80161720[0] == 0.0f) && (D_hud_80161720[1] == 0.0f) &&
(D_hud_80161720[2] == 0.0f)) {
if (decrease){
gDisplayedHitCount--;
} else {
gDisplayedHitCount++;
}
if ((gDisplayedHitCount == 4) || (gDisplayedHitCount == 9) || (gDisplayedHitCount == 14) ||
(gDisplayedHitCount == 19) || (gDisplayedHitCount == 24) || (gDisplayedHitCount == 29)) {