DX: arregla 'Vides /' al game over (bug de tostr amb negatius)

This commit is contained in:
2026-05-15 13:54:46 +02:00
parent cd319a3bec
commit 5fc43cebe3
2 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -745,7 +745,9 @@ function pintar_hud()
-- Text dins del marc
print(textos.level_label.." "..string.format("%02d", level), 3, 26)
print(textos.score_label.." "..string.format("%03d", score), 16, 26)
print(textos.lives_label.." "..tostr(pepe.vides), 29, 26)
-- max(0, ...) evita que la pantalla mostre "Vides /" en el game over:
-- l'implementacio de tostr() d'ascii torna "/" per a -1 (bug intern).
print(textos.lives_label.." "..tostr(max(0, pepe.vides)), 29, 26)
local r = textos.record_label.." "..string.format("%03d", hi_score).." "..nom_hi_score
print(r, flr((40 - strlen(r)) / 2), 28)
end