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