mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-12 15:44:10 +00:00
- Unfriendly players now spawn at deathmatch starts.
This commit is contained in:
parent
48e98c66de
commit
959fb2577b
2 changed files with 19 additions and 1 deletions
|
@ -1766,6 +1766,8 @@ void G_DoReborn (int playernum, bool freshbot)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
bool isUnfriendly = players[playernum].mo && !(players[playernum].mo->flags & MF_FRIENDLY);
|
||||||
|
|
||||||
// respawn at the start
|
// respawn at the start
|
||||||
// first disassociate the corpse
|
// first disassociate the corpse
|
||||||
if (players[playernum].mo)
|
if (players[playernum].mo)
|
||||||
|
@ -1775,7 +1777,7 @@ void G_DoReborn (int playernum, bool freshbot)
|
||||||
}
|
}
|
||||||
|
|
||||||
// spawn at random spot if in deathmatch
|
// spawn at random spot if in deathmatch
|
||||||
if (deathmatch)
|
if (deathmatch || isUnfriendly)
|
||||||
{
|
{
|
||||||
G_DeathMatchSpawnPlayer (playernum);
|
G_DeathMatchSpawnPlayer (playernum);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -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
|
// Don't count monsters in end-of-level sectors if option is on
|
||||||
if (dmflags2 & DF2_NOCOUNTENDMONST)
|
if (dmflags2 & DF2_NOCOUNTENDMONST)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue