map version check for loadents
parent
62de5eccf3
commit
79dd64c363
|
@ -45,7 +45,7 @@ bool loadents(const char *fname, vector<entity> &ents, uint *crc)
|
|||
octaheader hdr;
|
||||
if(f->read(&hdr, 7*sizeof(int))!=int(7*sizeof(int))) { conoutf(CON_ERROR, "map %s has malformatted header", ogzname); delete f; return false; }
|
||||
lilswap(&hdr.version, 6);
|
||||
if(memcmp(hdr.magic, "OCTA", 4) || hdr.worldsize <= 0|| hdr.numents < 0) { conoutf(CON_ERROR, "map %s has malformatted header", ogzname); delete f; return false; }
|
||||
if(memcmp(hdr.magic, "OCTA", 4) || hdr.worldsize <= 0|| hdr.numents < 0 || hdr.version<33) { conoutf(CON_ERROR, "map %s has malformatted header", ogzname); delete f; return false; }
|
||||
if(hdr.version>MAPVERSION) { conoutf(CON_ERROR, "map %s requires a newer version of Tesseract", ogzname); delete f; return false; }
|
||||
if(f->read(&hdr.blendmap, sizeof(hdr) - 7*sizeof(int)) != int(sizeof(hdr) - 7*sizeof(int))) { conoutf(CON_ERROR, "map %s has malformatted header", ogzname); delete f; return false; }
|
||||
|
||||
|
|
Loading…
Reference in New Issue