simple map revisioning system

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4357 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
ac_stef
2009-04-26 19:16:33 +00:00
parent c51b5b9e43
commit 60bf761971
10 changed files with 79 additions and 33 deletions
+6 -1
View File
@@ -332,7 +332,12 @@ mapstats *loadmapstats(const char *filename, bool getlayout)
if(gzread(f, &s.hdr, sizeof(header)-sizeof(int)*16)!=sizeof(header)-sizeof(int)*16 || (strncmp(s.hdr.head, "CUBE", 4) && strncmp(s.hdr.head, "ACMP",4))) { gzclose(f); return NULL; }
endianswap(&s.hdr.version, sizeof(int), 4);
if(s.hdr.version>MAPVERSION || s.hdr.numents > MAXENTITIES || (s.hdr.version>=4 && gzread(f, &s.hdr.waterlevel, sizeof(int)*16)!=sizeof(int)*16)) { gzclose(f); return NULL; }
if(s.hdr.version>=4) endianswap(&s.hdr.waterlevel, sizeof(int), 1); else s.hdr.waterlevel = -100000;
if(s.hdr.version>=4)
{
endianswap(&s.hdr.waterlevel, sizeof(int), 1);
endianswap(&s.hdr.maprevision, sizeof(int), 1);
}
else s.hdr.waterlevel = -100000;
entity e;
enttypes = new uchar[s.hdr.numents];
entposs = new short[s.hdr.numents * 3];