auto-forceteam (new autoteam), shuffleteams (skill sorted), autosendmap fix, better arenaspawn distribution (unfinished)

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2443 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
ac_stef
2008-08-30 22:10:04 +00:00
parent f15b98402f
commit 863450c0e2
14 changed files with 272 additions and 60 deletions
+10
View File
@@ -229,6 +229,7 @@ void save_world(char *mname)
}
extern void preparectf(bool cleanonly = false);
int numspawn[3], maploaded = 0;
bool load_world(char *mname) // still supports all map formats that have existed since the earliest cube betas!
{
@@ -237,6 +238,7 @@ bool load_world(char *mname) // still supports all map formats that have
pruneundos();
clearworldsounds();
setnames(mname);
maploaded = getfilesize(cgzname);
gzFile f = opengzfile(cgzname, "rb9");
if(!f) { conoutf("\f3could not read map %s", cgzname); return false; }
loadingscreen();
@@ -256,6 +258,7 @@ bool load_world(char *mname) // still supports all map formats that have
hdr.waterlevel = -100000;
}
ents.setsize(0);
loopi(3) numspawn[i] = 0;
loopi(hdr.numents)
{
entity &e = ents.add();
@@ -304,6 +307,13 @@ bool load_world(char *mname) // still supports all map formats that have
e.type=NOTUSED;
}
}
if(e.type == PLAYERSTART && (e.attr2 == 0 || e.attr2 == 1 || e.attr2 == 100))
{
if(e.attr2 == 100)
numspawn[2]++;
else
numspawn[e.attr2]++;
}
}
delete[] world;
setupworld(hdr.sfactor);