doing it better... (still testing the exploit, tbh)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6494 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -303,8 +303,7 @@ bool good_map() // call this function only at startmap
|
||||
}
|
||||
}
|
||||
|
||||
map_quality = (!item_fail && F2F > MINFF && MA < MAXMAREA && Mh < MAXMHEIGHT &&
|
||||
Hhits < MAXHHITS && Hhits * 3 < Ma) ? MAP_IS_GOOD : MAP_IS_BAD;
|
||||
map_quality = (!item_fail && F2F > MINFF && MA < MAXMAREA && Mh < MAXMHEIGHT && Hhits < MAXHHITS) ? MAP_IS_GOOD : MAP_IS_BAD;
|
||||
if ( (!connected || gamemode == GMODE_COOPEDIT) && map_quality == MAP_IS_BAD ) map_quality = MAP_IS_EDITABLE;
|
||||
return map_quality > 0;
|
||||
}
|
||||
|
||||
+1
-4
@@ -26,10 +26,7 @@ inline float fACos( float x )
|
||||
}
|
||||
#undef UFINVSQRT
|
||||
|
||||
inline float pow2(float x)
|
||||
{
|
||||
return x*x;
|
||||
}
|
||||
template <typename T> inline T pow2(T x) { return x*x; }
|
||||
|
||||
// Fast Cosine
|
||||
// inspired after http://www.devmaster.net/forums/showthread.php?t=5784
|
||||
|
||||
@@ -239,10 +239,7 @@ bool mapisok(mapstats *ms)
|
||||
{
|
||||
if ( Mheight > MAXMHEIGHT ) { logline(ACLOG_INFO, "MAP CHECK FAIL: The overall ceil height is too high (%.1f cubes)", Mheight); return false; }
|
||||
if ( Mopen > MAXMAREA ) { logline(ACLOG_INFO, "MAP CHECK FAIL: There is a big open area in this (hint: use more solid walls)", Mheight); return false; }
|
||||
if ( SHhits > MAXHHITS || SHhits * 3 > Marea )
|
||||
{
|
||||
logline(ACLOG_INFO, "MAP CHECK FAIL: Too high height in some parts of the map (%d hits)", SHhits); return false;
|
||||
}
|
||||
if ( SHhits > MAXHHITS ) { logline(ACLOG_INFO, "MAP CHECK FAIL: Too high height in some parts of the map (%d hits)", SHhits); return false; }
|
||||
|
||||
if ( ms->hasflags ) // Check if flags are ok
|
||||
{
|
||||
|
||||
@@ -126,7 +126,7 @@ mapstats *loadmapstats(const char *filename, bool getlayout)
|
||||
}
|
||||
if ( type != SOLID && diff > 6 )
|
||||
{
|
||||
if (diff > MAXMHEIGHT) SHhits += diff * n;
|
||||
if (diff > MAXMHEIGHT) SHhits += pow2(diff-MAXMHEIGHT)*n;
|
||||
Marea += n;
|
||||
Mvolume += diff * n;
|
||||
}
|
||||
|
||||
+1
-1
@@ -127,7 +127,7 @@ struct mapstats
|
||||
#define OUTBORDRAD(x,y,rad) (int(x-rad)<MINBORD || int(y-rad)<MINBORD || int(x+rad)>=ssize-MINBORD || (y+rad)>=ssize-MINBORD)
|
||||
#define MAXMHEIGHT 30
|
||||
#define MAXMAREA 10000
|
||||
#define MAXHHITS 30000
|
||||
#define MAXHHITS 5000
|
||||
#define MINFF 2500
|
||||
|
||||
struct block { int x, y, xs, ys; };
|
||||
|
||||
@@ -643,7 +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;
|
||||
if (diff > MAXMHEIGHT) Hhits += pow2(diff-MAXMHEIGHT)*n;
|
||||
Ma += n;
|
||||
Mv += diff * n;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user