Skip to content
Snippets Groups Projects
Commit 45583b19 authored by Sal's avatar Sal
Browse files

Merge branch 'emeraldnum-restrict' into 'master'

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

See merge request KartKrew/Kart!2271
parents 077f1234 17801d52
Branches
Tags
No related merge requests found
......@@ -4086,16 +4086,30 @@ void readcupheader(MYFILE *f, cupheader_t *cup)
cup->cachedlevels[CUPCACHE_PODIUM] = NEXTMAP_INVALID;
}
else if (fastcmp(word, "EMERALDNUM"))
{
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("You must define a custom gamedata to use \"%s\"", word);
}
}
else if (fastcmp(word, "PLAYCREDITS"))
{
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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment