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

Function ValidateMap

source/core/menu/usermap.cpp:79–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79bool ValidateMap(int lumpnum)
80{
81 FString filename = fileSystem.GetFileFullName(lumpnum);
82
83 if (fileSystem.FindFile(filename.GetChars()) != lumpnum) return false;
84 auto fr = fileSystem.OpenFileReader(lumpnum);
85 uint8_t check[4];
86 fr.Read(&check, 4);
87 if (!isBlood())
88 {
89 if (check[0] < 5 || check[0] > 9 || check[1] || check[2] || check[3]) return false;
90 }
91 else
92 {
93 if (memcmp(check, "BLM\x1a", 4)) return false;
94 }
95 return true;
96}
97
98void SortEntries(FUsermapDirectory& dir)
99{

Callers 1

ReadUserMapsFunction · 0.85

Calls 6

isBloodFunction · 0.85
GetFileFullNameMethod · 0.80
FindFileMethod · 0.80
GetCharsMethod · 0.45
OpenFileReaderMethod · 0.45
ReadMethod · 0.45

Tested by

no test coverage detected