mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
Do not close game if fallback character is missing
It's quite rude to close the game. Especially if the user does not use the console. They won't know why the game closed. Instead, just return -1. All usages of font_idx() should be and are bounds checked anyways. This will result in missing characters, but, it's not like the characters had a font image in the first place, otherwise we wouldn't be here. And if the user sees a bunch of characters missing in their font, they'll probably work out what the problem is even without having a console. And it's still far better than abruptly closing the game. And use WHINE_ONCE to prevent spamming the console.
This commit is contained in:
parent
3094ddb8f3
commit
1841f1886a
1 changed files with 2 additions and 2 deletions
|
@ -258,8 +258,8 @@ int Graphics::font_idx(uint32_t ch)
|
|||
iter = font_positions.find('?');
|
||||
if (iter == font_positions.end())
|
||||
{
|
||||
puts("font.txt missing fallback character!");
|
||||
VVV_exit(1);
|
||||
WHINE_ONCE("font.txt missing fallback character!");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return iter->second;
|
||||
|
|
Loading…
Reference in a new issue