- Implemented sv_singleplayerrespawn

This commit is contained in:
Rachael Alexanderson 2016-10-23 06:06:59 -04:00 committed by Christoph Oelckers
commit 043e761eec
4 changed files with 12 additions and 5 deletions

View file

@ -526,6 +526,8 @@ static bool unloading;
//
//==========================================================================
EXTERN_CVAR(Bool, sv_singleplayerrespawn)
void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill)
{
level_info_t *nextinfo = NULL;
@ -634,7 +636,7 @@ void G_ChangeLevel(const char *levelname, int position, int flags, int nextSkill
// If this is co-op, respawn any dead players now so they can
// keep their inventory on the next map.
if ((multiplayer || level.flags2 & LEVEL2_ALLOWRESPAWN) && !deathmatch && player->playerstate == PST_DEAD)
if ((multiplayer || level.flags2 & LEVEL2_ALLOWRESPAWN || sv_singleplayerrespawn) && !deathmatch && player->playerstate == PST_DEAD)
{
// Copied from the end of P_DeathThink [[
player->cls = NULL; // Force a new class if the player is using a random class