- Added MAPINFO flag RandomPlayerStarts. In this mode, no voodoo dolls are spawned. Instead, all

player starts are added to a pool, and players spawn at a random spot.

SVN r3749 (trunk)
This commit is contained in:
Randy Heit 2012-07-08 01:43:47 +00:00
commit 71601f91d1
11 changed files with 85 additions and 43 deletions

View file

@ -184,6 +184,7 @@ bool ForceNodeBuild;
// Maintain single and multi player starting spots.
TArray<FMapThing> deathmatchstarts (16);
FMapThing playerstarts[MAXPLAYERS];
TArray<FMapThing> AllPlayerStarts;
static void P_AllocateSideDefs (int count);
@ -3910,7 +3911,9 @@ void P_SetupLevel (char *lumpname, int position)
for (i = 0; i < BODYQUESIZE; i++)
bodyque[i] = NULL;
deathmatchstarts.Clear ();
deathmatchstarts.Clear();
AllPlayerStarts.Clear();
memset(playerstarts, 0, sizeof(playerstarts));
if (!buildmap)
{
@ -3977,6 +3980,19 @@ void P_SetupLevel (char *lumpname, int position)
}
}
}
// the same, but for random single/coop player starts
else if (level.flags2 & LEVEL2_RANDOMPLAYERSTARTS)
{
for (i = 0; i < MAXPLAYERS; ++i)
{
if (playeringame[i])
{
players[i].mo = NULL;
FMapThing *mthing = G_PickPlayerStart(i);
P_SpawnPlayer(mthing, i);
}
}
}
// Don't count monsters in end-of-level sectors if option is on
if (dmflags2 & DF2_NOCOUNTENDMONST)