From 8dda7c02c9397abf88392e0043ded0311e924ac6 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Wed, 15 Apr 2020 06:58:27 -0400 Subject: [PATCH] - fixed: player spawn code should now always use defaults for the currently selected player class, not current flags --- src/g_game.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/g_game.cpp b/src/g_game.cpp index 0bf781260..d3f05f88d 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1707,7 +1707,18 @@ void FLevelLocals::DoReborn (int playernum, bool freshbot) } else { - bool isUnfriendly = players[playernum].mo && !(players[playernum].mo->flags & MF_FRIENDLY); + bool isUnfriendly; + auto p = players[playernum].mo->player; + if (p->cls == NULL) + { + // this shouldn't ever happen! It's just a fall-through in case it does... + isUnfriendly = players[playernum].mo && !(players[playernum].mo->GetDefault()->flags & MF_FRIENDLY); + } + else + { + isUnfriendly = !(GetDefaultByType(p->cls)->flags & MF_FRIENDLY); + } + // respawn at the start // first disassociate the corpse