MCPcopy Create free account
hub / github.com/ZDoom/Raze / GetDefaultLevelNum

Function GetDefaultLevelNum

source/core/g_mapinfo.cpp:1312–1331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1310//==========================================================================
1311
1312static int GetDefaultLevelNum(const char *mapname)
1313{
1314 if ((!strnicmp (mapname, "MAP", 3) || !strnicmp(mapname, "LEV", 3)) && strlen(mapname) <= 5)
1315 {
1316 int mapnum = atoi (mapname + 3);
1317
1318 if (mapnum >= 1 && mapnum <= 99)
1319 return mapnum;
1320 }
1321 else if (mapname[0] == 'E' &&
1322 mapname[1] >= '0' && mapname[1] <= '9' &&
1323 (mapname[2] == 'M' || mapname[2] == 'L') &&
1324 mapname[3] >= '0' && mapname[3] <= '9')
1325 {
1326 int epinum = mapname[1] - '0';
1327 int mapnum = mapname[3] - '0';
1328 return makelevelnum(epinum, mapnum);
1329 }
1330 return 0;
1331}
1332
1333//==========================================================================
1334//

Callers 1

ParseMapHeaderMethod · 0.85

Calls 1

makelevelnumFunction · 0.85

Tested by

no test coverage detected