stats: fix the distance travelled display when over 1000m

Resolves #2659.
This commit is contained in:
walkawayy 2025-03-20 20:01:44 -04:00
parent 66d1b59330
commit e7809774f4
3 changed files with 3 additions and 2 deletions

View file

@ -38,6 +38,7 @@
- fixed the ammo counter not showing in demos if NG+ is set (#2574, regression from 0.9)
- fixed being able to play with Lara invisible after using the explosion cheat then the fly cheat (#2584, regression from 0.9)
- fixed the `/pos` command not showing demo and cutscene titles
- fixed the distance travelled stat displaying the wrong value when over 1000m (#2659)
- improved camera mode navigation:
- improved support for pivoting
- improved roll support

View file

@ -198,7 +198,7 @@ static void M_AddRowFromRole(
} else {
sprintf(
buf, "%d.%02dkm", distance_travelled / 1000,
distance_travelled % 100);
(distance_travelled % 1000) / 10);
}
M_AddRow(self, role, GS(STATS_DISTANCE_TRAVELLED), buf);
break;

View file

@ -138,7 +138,7 @@ static void M_AddRowFromRole(
if (distance < 1000) {
sprintf(buf, "%dm", distance);
} else {
sprintf(buf, "%d.%02dkm", distance / 1000, distance % 100);
sprintf(buf, "%d.%02dkm", distance / 1000, (distance % 1000) / 10);
}
M_AddRow(self, role, GS(STATS_DISTANCE_TRAVELLED), buf);
break;