G_UpdateTimeStickerMedals: Fixes for issues with invalid ghost-Medal combinations.

- Only set timetoreach from Medal's var in valid cases
- Shorter invalid phrases to fit in 9-long buffer
This commit is contained in:
toaster 2023-02-06 00:00:12 +00:00
parent 31dcb3346e
commit 75ee5d1c0b

View file

@ -547,17 +547,18 @@ bademblem:
if (gonnadrawtime) if (gonnadrawtime)
{ {
stickermedalinfo.timetoreach = emblem->var;
if (emblem->tag > 0) if (emblem->tag > 0)
{ {
if (emblem->tag > mapheaderinfo[map]->ghostCount if (emblem->tag > mapheaderinfo[map]->ghostCount
|| mapheaderinfo[map]->ghostBrief[emblem->tag-1] == NULL) || mapheaderinfo[map]->ghostBrief[emblem->tag-1] == NULL)
snprintf(stickermedalinfo.targettext, 9, "Invalid ghost tag"); snprintf(stickermedalinfo.targettext, 9, "Invalid");
else if (mapheaderinfo[map]->ghostBrief[emblem->tag-1]->time == UINT32_MAX) else if (mapheaderinfo[map]->ghostBrief[emblem->tag-1]->time == UINT32_MAX)
snprintf(stickermedalinfo.targettext, 9, "Ghost DNF"); snprintf(stickermedalinfo.targettext, 9, "DNF");
else else
stickermedalinfo.timetoreach = mapheaderinfo[map]->ghostBrief[emblem->tag-1]->time; stickermedalinfo.timetoreach = mapheaderinfo[map]->ghostBrief[emblem->tag-1]->time;
} }
else
stickermedalinfo.timetoreach = emblem->var;
} }
} }