MCPcopy Create free account
hub / github.com/assaultcube/AC / fixmapheadersize

Function fixmapheadersize

source/src/tools.cpp:76–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76int fixmapheadersize(int version, int headersize) // we can't trust hdr.headersize for file versions < 10 (thx flow)
77{
78 if(version < 4) return sizeof(header) - sizeof(int) * 16;
79 else if(version == 7 || version == 8) return sizeof(header) + sizeof(char) * 128; // mediareq
80 else if(version < 10 || headersize < int(sizeof(header))) return sizeof(header);
81 return headersize;
82}
83
84header *peekmapheader(uchar *data, int len) // extract the header from an in-memory mapfile (doesn't process all values: only used to get the map revision and timestamp)
85{

Callers 2

loadMethod · 0.85
load_worldFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected