| 1339 | static MapRecord sink; |
| 1340 | |
| 1341 | MapRecord *FMapInfoParser::ParseMapHeader(MapRecord &defaultinfo) |
| 1342 | { |
| 1343 | FString mapname; |
| 1344 | MapRecord* map; |
| 1345 | |
| 1346 | if (!CheckLegacyMapDefinition(mapname)) |
| 1347 | { |
| 1348 | ParseLookupName(mapname); |
| 1349 | } |
| 1350 | |
| 1351 | if (mapname.IsEmpty()) |
| 1352 | { |
| 1353 | map = &sink; // parse over the entire definition but discard the result. |
| 1354 | } |
| 1355 | else |
| 1356 | { |
| 1357 | map = FindMapByName(mapname.GetChars()); |
| 1358 | if (!map) |
| 1359 | { |
| 1360 | map = AllocateMap(); |
| 1361 | *map = defaultinfo; |
| 1362 | DefaultExtension(mapname, ".map"); |
| 1363 | map->SetFileName(mapname.GetChars()); |
| 1364 | } |
| 1365 | } |
| 1366 | |
| 1367 | if (!sc.CheckString("{")) |
| 1368 | { |
| 1369 | sc.MustGetString(); |
| 1370 | map->name = sc.String; |
| 1371 | } |
| 1372 | else |
| 1373 | { |
| 1374 | if (map != &sink && map->name.IsEmpty()) sc.ScriptError("Missing level name"); |
| 1375 | sc.UnGet(); |
| 1376 | } |
| 1377 | if (map->levelNumber <= 0) map->levelNumber = GetDefaultLevelNum(map->labelName.GetChars()); |
| 1378 | return map; |
| 1379 | } |
| 1380 | |
| 1381 | |
| 1382 | //========================================================================== |
nothing calls this directly
no test coverage detected