1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-25 09:30:35 +00:00

fixed a possible crash with bad Steam data

This commit is contained in:
Zeno Rogue 2024-05-05 15:10:45 +02:00
parent d9a03ab1d3
commit bc22d17a16

View File

@ -108,7 +108,11 @@ string displayfor(int scoredisplay, score* S, bool shorten = false) {
return buf;
}
if(scoredisplay == POSSCORE) return modedesc(S);
if(scoredisplay == 68) return S->yasc_message + XLAT(" in %the1", eLand(S->box[68]));
if(scoredisplay == 68) {
eLand which = eLand(S->box[68]);
if(which >= landtypes || which < 0) return "fail";
return S->yasc_message + XLAT(" in %the1", which);
}
if(scoredisplay == 1) {
time_t tim = S->box[1];
char buf[128]; strftime(buf, 128, "%c", localtime(&tim));