making the map quality requisites more transparent: 1) "MAP CHECK FAIL" messages in the server logs; 2) console messages to the client (WiP).

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5769 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Rafael Barreto
2010-10-19 12:28:17 +00:00
parent f4553d86c5
commit 29bea67da1
6 changed files with 22 additions and 11 deletions
+6 -5
View File
@@ -243,12 +243,13 @@ char *mlayout = NULL;
int Mv = 0, Ma = 0; // moved up:, MA = 0;
float Mh = 0;
extern int connected;
int map_quality = MAP_IS_EDITABLE;
bool good_map()
bool good_map() // call this function only at startmap
{
if (!connected || gamemode == GMODE_COOPEDIT) return true;
bool checked = (MA==0) ? ((MA = checkarea(sfactor, mlayout)) < MAXMAREA && Mh < MAXMHEIGHT) : true;
return checked;
map_quality = ((MA = checkarea(sfactor, mlayout)) < MAXMAREA && Mh < MAXMHEIGHT) ? MAP_IS_GOOD : MAP_IS_BAD;
if ( (!connected || gamemode == GMODE_COOPEDIT) && map_quality == MAP_IS_BAD ) map_quality = MAP_IS_EDITABLE;
return map_quality;
}
VARP(hudextras, 0, 0, 3);
@@ -549,7 +550,7 @@ void parsemessages(int cn, playerent *d, ucharbuf &p)
case SV_SPAWNSTATE:
{
if ( !good_map() )
if ( map_quality == MAP_IS_BAD )
{
loopi(6+2*NUMGUNS) getint(p);
conoutf(_("map deemed unplayable - fix it before you can spawn"));