Merge branch 'emeraldnum-restrict' into 'master'

Emeraldnum and playcredits can only be set when initialising a new gamedata

See merge request KartKrew/Kart!2271
This commit is contained in:
Sal 2024-04-14 07:42:15 +00:00
commit 45583b1944

View file

@ -4087,14 +4087,28 @@ void readcupheader(MYFILE *f, cupheader_t *cup)
}
else if (fastcmp(word, "EMERALDNUM"))
{
if (i >= 0 && i <= 14)
cup->emeraldnum = (UINT8)i;
if (!mainwads || (refreshdirmenu & REFRESHDIR_GAMEDATA))
{
if (i >= 0 && i <= 14)
cup->emeraldnum = (UINT8)i;
else
deh_warning("%s Cup: invalid emerald number %d", cup->name, i);
}
else
deh_warning("%s Cup: invalid emerald number %d", cup->name, i);
{
deh_warning("You must define a custom gamedata to use \"%s\"", word);
}
}
else if (fastcmp(word, "PLAYCREDITS"))
{
cup->playcredits = (i != 0 || word2[0] == 'T' || word2[0] == 'Y');
if (!mainwads || (refreshdirmenu & REFRESHDIR_GAMEDATA))
{
cup->playcredits = (i != 0 || word2[0] == 'T' || word2[0] == 'Y');
}
else
{
deh_warning("You must define a custom gamedata to use \"%s\"", word);
}
}
else
deh_warning("%s Cup: unknown word '%s'", cup->name, word);