avoiding lag-speedhack in flag pick up, fixes into showmapstats functions

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5776 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Rafael Barreto
2010-10-19 23:14:58 +00:00
parent 8c24608ca6
commit f95c2a3e28
2 changed files with 5 additions and 4 deletions
+2 -2
View File
@@ -252,17 +252,17 @@ bool good_map() // call this function only at startmap
{
if (mlayout) MA = checkarea(sfactor, mlayout);
F2F = 1000 * MINFF;
if(m_flags)
{
flaginfo &f0 = flaginfos[0];
flaginfo &f1 = flaginfos[1];
#define DIST(x) (f0.pos.x - f1.pos.x)
F2F = (!numflagspawn[0] || !numflagspawn[1]) ? 1000 * MINFF : (int) fSqrt(DIST(x)*DIST(x)+DIST(y)*DIST(y));
F2F = (!numflagspawn[0] || !numflagspawn[1]) ? 1000 * MINFF : DIST(x)*DIST(x)+DIST(y)*DIST(y);
#undef DIST
}
item_fail = false;
loopv(ents)
{
entity &e1 = ents[i];
+3 -2
View File
@@ -735,7 +735,8 @@ bool flagdistance(sflaginfo &f, int cn)
v.x = f.pos[0]; v.y = f.pos[1];
break;
}
if(v.x < 0) return true;
bool lagging = (c.ping < 1000 && c.spj < 100);
if(v.x < 0 && !lagging) return true;
float dist = c.state.o.dist(v);
int pdist = check_pdist(&c,dist);
if(pdist)
@@ -745,7 +746,7 @@ bool flagdistance(sflaginfo &f, int cn)
c.hostname, c.name, (pdist==2?"tried to touch":"touched"), team_string(&f == sflaginfos + 1), dist, c.farpickups);
if (pdist==2) return false;
}
return true;
return lagging ? false : true; // today I found a lag hacker :: Brahma, 19-oct-2010... lets test it a bit
}
void sendflaginfo(int flag = -1, int cn = -1)