Replace more instances of M_MapNumber in SOC

This commit is contained in:
James R 2020-10-31 17:44:24 -07:00
parent 2520b87f76
commit 6cda446f91

View file

@ -2140,13 +2140,13 @@ static void readcupheader(MYFILE *f, cupheader_t *cup)
tmp = strtok(word2,","); tmp = strtok(word2,",");
do { do {
INT32 map = atoi(tmp); INT32 map = G_MapNumber(tmp);
if (tmp[0] >= 'A' && tmp[0] <= 'Z' && tmp[2] == '\0') if (map >= nummapheaders)
map = M_MapNumber(tmp[0], tmp[1]); {
deh_warning("Unknown map name '%s'\n", tmp);
if (!map)
break; break;
}
if (cup->numlevels >= MAXLEVELLIST) if (cup->numlevels >= MAXLEVELLIST)
{ {
@ -2161,16 +2161,12 @@ static void readcupheader(MYFILE *f, cupheader_t *cup)
else if (fastcmp(word, "BONUSGAME")) else if (fastcmp(word, "BONUSGAME"))
{ {
// Convert to map number // Convert to map number
if (word2[0] >= 'A' && word2[0] <= 'Z' && word2[2] == '\0') cup->bonusgame = (INT16)G_MapNumber(word2) - 1;
i = M_MapNumber(word2[0], word2[1]);
cup->bonusgame = (INT16)i - 1;
} }
else if (fastcmp(word, "SPECIALSTAGE")) else if (fastcmp(word, "SPECIALSTAGE"))
{ {
// Convert to map number // Convert to map number
if (word2[0] >= 'A' && word2[0] <= 'Z' && word2[2] == '\0') cup->specialstage = (INT16)G_MapNumber(word2) - 1;
i = M_MapNumber(word2[0], word2[1]);
cup->specialstage = (INT16)i - 1;
} }
else if (fastcmp(word, "EMERALDNUM")) else if (fastcmp(word, "EMERALDNUM"))
{ {