Skip to content

Commit

Permalink
- Blood: validate .ini files before using them.
Browse files Browse the repository at this point in the history
They must at least have one "Episode?" section to be accepted.
  • Loading branch information
coelckers authored and mjr4077au committed Jul 17, 2021
1 parent 904160e commit e63ff28
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion source/games/blood/src/levels.cpp
Expand Up @@ -126,7 +126,19 @@ static const char* DefFile(void)
if (ext.CompareNoCase(".ini") == 0)
{
if (fileSystem.CheckNumForFullName(fn) != i) continue;
if (found == -1) found = i;
if (found == -1)
{
IniFile inif(fn);
for (int j = 1; j <= 6; j++)
{
FStringf key("Episode%d", j);
if (inif.FindKey(key))
{
found = i;
break;
}
}
}
else
{
found = -1;
Expand Down

0 comments on commit e63ff28

Please sign in to comment.