fixing that obvious map requirements exploit... (no more exploits for the next 6 months...)

@ other devs: check my fix... I expect to not block any good map

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6490 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Rafael Barreto
2011-06-03 21:19:44 +00:00
parent de3f70ac3b
commit a8401fd1e3
6 changed files with 19 additions and 10 deletions
+3 -2
View File
@@ -469,7 +469,7 @@ int numspawn[3], maploaded = 0, numflagspawn[2];
VAR(curmaprevision, 1, 0, 0);
extern char *mlayout;
extern int Mv, Ma;
extern int Mv, Ma, Hhits;
extern float Mh;
bool load_world(char *mname) // still supports all map formats that have existed since the earliest cube betas!
@@ -549,7 +549,7 @@ bool load_world(char *mname) // still supports all map formats that have
mlayout = new char[cubicsize + 256];
memset(mlayout, 0, cubicsize * sizeof(char));
char diff = 0;
Mv = Ma = 0;
Mv = Ma = Hhits = 0;
if(!mapinfo.numelems || (mapinfo.access(mname) && !cmpf(cgzname, mapinfo[mname]))) world = (sqr *)ents.getbuf();
c2skeepalive();
@@ -643,6 +643,7 @@ bool load_world(char *mname) // still supports all map formats that have
}
if ( type != SOLID && diff > 6 )
{
if (diff > MAXMHEIGHT) Hhits += diff * n;
Ma += n;
Mv += diff * n;
}