- Unfriendly players now spawn at deathmatch starts.

This commit is contained in:
Rachael Alexanderson 2017-03-14 04:02:40 -04:00
parent 48e98c66de
commit 959fb2577b
2 changed files with 19 additions and 1 deletions

View file

@ -1766,6 +1766,8 @@ void G_DoReborn (int playernum, bool freshbot)
}
else
{
bool isUnfriendly = players[playernum].mo && !(players[playernum].mo->flags & MF_FRIENDLY);
// respawn at the start
// first disassociate the corpse
if (players[playernum].mo)
@ -1775,7 +1777,7 @@ void G_DoReborn (int playernum, bool freshbot)
}
// spawn at random spot if in deathmatch
if (deathmatch)
if (deathmatch || isUnfriendly)
{
G_DeathMatchSpawnPlayer (playernum);
return;

View file

@ -4080,6 +4080,22 @@ void P_SetupLevel (const char *lumpname, int position)
}
}
// [SP] move unfriendly players around
// horribly hacky - yes, this needs rewritten.
for (i = 0; i < MAXPLAYERS; ++i)
{
if (playeringame[i] && players[i].mo != NULL)
{
if (!(players[i].mo->flags & MF_FRIENDLY))
{
AActor * oldSpawn = players[i].mo;
G_DeathMatchSpawnPlayer (i);
oldSpawn->Destroy();
}
}
}
// Don't count monsters in end-of-level sectors if option is on
if (dmflags2 & DF2_NOCOUNTENDMONST)
{