mirror of
https://github.com/HarbourMasters/Starship.git
synced 2025-02-13 13:35:18 +03:00
Generally support decreasing scores. Prevents a bug when using score editor to lower the score
This commit is contained in:
parent
b133f925e6
commit
fbc101958b
@ -5503,13 +5503,18 @@ 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 {
|
||||
} 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) {
|
||||
temp4++;
|
||||
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)) {
|
||||
temp4++;
|
||||
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)) {
|
||||
gDisplayedHitCount++;
|
||||
if (decrease){
|
||||
gDisplayedHitCount--;
|
||||
} else {
|
||||
gDisplayedHitCount++;
|
||||
}
|
||||
|
||||
if ((gDisplayedHitCount == 4) || (gDisplayedHitCount == 9) || (gDisplayedHitCount == 14) ||
|
||||
(gDisplayedHitCount == 19) || (gDisplayedHitCount == 24) || (gDisplayedHitCount == 29)) {
|
||||
|
Loading…
Reference in New Issue
Block a user