diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index d56e8ca4..8da84dd0 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -26,9 +26,10 @@ VARP(autogetmap, 0, 1, 1); // only if the client doesn't have that map VARP(autogetnewmaprevisions, 0, 1, 1); bool localwrongmap = false; - +int MA = 0; // flowtron: moved here bool changemapserv(char *name, int mode, int download, int revision) // forced map change from the server { + MA = 0; // reset for checkarea() gamemode = mode; if(m_demo) return true; if(m_coop) @@ -219,14 +220,14 @@ void parsepositions(ucharbuf &p) extern int checkarea(int maplayout_factor, char *maplayout); char *mlayout = NULL; -int Mv = 0, Ma = 0, MA = 0; +int Mv = 0, Ma = 0; // moved up:, MA = 0; float Mh = 0; extern int connected; bool good_map() { - bool checked = ((MA = checkarea(sfactor, mlayout)) < MAXMAREA && Mh < MAXMHEIGHT); if (!connected || gamemode == GMODE_COOPEDIT) return true; + bool checked = (MA==0) ? ((MA = checkarea(sfactor, mlayout)) < MAXMAREA && Mh < MAXMHEIGHT) : true; return checked; } @@ -271,7 +272,7 @@ void showhudextras(char hudextras, char value){ if (!p || p == player1) teamworkid = -1; else outf("\f4you replied to %s",p->name); } - else outf("\f3Update your client, NOOB!"); + else outf("\f3Update your client!"); break; } } diff --git a/source/src/serveractions.h b/source/src/serveractions.h index b5b9486c..fee14ea3 100644 --- a/source/src/serveractions.h +++ b/source/src/serveractions.h @@ -35,8 +35,8 @@ void kick_abuser(int cn, int &cmillis, int &count, int limit) bool mapisok(mapstats *ms) { - /* Check if flags are ok */ - if ( ms->hasflags ) { + if ( ms->hasflags ) // Check if flags are ok + { struct { short x, y; } fl[2]; loopi(2) { @@ -50,7 +50,6 @@ bool mapisok(mapstats *ms) FlagFlag = pow2(fl[0].x - fl[1].x) + pow2(fl[0].y - fl[1].y); } else FlagFlag = MINFF * 1000; // the map has no flags - return Mheight < MAXMHEIGHT && (Mopen = checkarea(testlayout_factor, testlayout)) < MAXMAREA && FlagFlag > MINFF; } diff --git a/source/src/serverchecks.h b/source/src/serverchecks.h index c370918f..7d9a6819 100644 --- a/source/src/serverchecks.h +++ b/source/src/serverchecks.h @@ -10,6 +10,7 @@ inline float pow2(float x) //FIXME /* There are smarter ways to implement this function */ +// flowtron: 2010jun27 : mapdims[6] is probably "good enough" - so this might be deprecated - mapdims would need a server-side implementation though. int getmaxarea(int inversed_x, int inversed_y, int transposed, int maplayout_factor, char *maplayout) { int ls = (1 << maplayout_factor); @@ -433,7 +434,7 @@ void checkfrag (client *target, client *actor, int gun, bool gib) else addpt(actor, TKPT); } - } + } } int next_afk_check = 200;