diff --git a/src/g_game.cpp b/src/g_game.cpp index 404484672..82bff3f73 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1743,7 +1743,8 @@ static void G_QueueBody (AActor *body) EXTERN_CVAR(Bool, sv_singleplayerrespawn) void G_DoReborn (int playernum, bool freshbot) { - if (!multiplayer && !(level.flags2 & LEVEL2_ALLOWRESPAWN) && !sv_singleplayerrespawn) + if (!multiplayer && !(level.flags2 & LEVEL2_ALLOWRESPAWN) && !sv_singleplayerrespawn && + !G_SkillProperty(SKILLP_PlayerRespawn)) { if (BackupSaveName.Len() > 0 && FileExists (BackupSaveName.GetChars())) { // Load game from the last point it was saved diff --git a/src/g_level.h b/src/g_level.h index 7fb38a046..78dcd55b1 100644 --- a/src/g_level.h +++ b/src/g_level.h @@ -538,6 +538,7 @@ enum ESkillProperty SKILLP_EasyKey, SKILLP_SlowMonsters, SKILLP_Infight, + SKILLP_PlayerRespawn, }; enum EFSkillProperty // floating point properties { @@ -595,6 +596,7 @@ struct FSkillInfo double FriendlyHealth; bool NoPain; int Infighting; + bool PlayerRespawn; FSkillInfo() {} FSkillInfo(const FSkillInfo &other) diff --git a/src/g_skill.cpp b/src/g_skill.cpp index 6e23c9523..5c252274f 100644 --- a/src/g_skill.cpp +++ b/src/g_skill.cpp @@ -89,6 +89,7 @@ void FMapInfoParser::ParseSkill () skill.FriendlyHealth = 1.; skill.NoPain = false; skill.Infighting = 0; + skill.PlayerRespawn = false; sc.MustGetString(); skill.Name = sc.String; @@ -155,6 +156,10 @@ void FMapInfoParser::ParseSkill () { skill.NoMenu = true; } + else if (sc.Compare ("playerrespawn")) + { + skill.PlayerRespawn = true; + } else if (sc.Compare("respawntime")) { ParseAssign(); @@ -397,6 +402,9 @@ int G_SkillProperty(ESkillProperty prop) if (AllSkills[gameskill].Infighting == LEVEL2_TOTALINFIGHTING) return 1; if (AllSkills[gameskill].Infighting == LEVEL2_NOINFIGHTING) return -1; return infighting; + + case SKILLP_PlayerRespawn: + return AllSkills[gameskill].PlayerRespawn; } } return 0; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 561334a52..dc0e76ad1 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -5648,7 +5648,8 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags) { // Give all cards in death match mode. p->mo->GiveDeathmatchInventory (); } - else if ((multiplayer || (level.flags2 & LEVEL2_ALLOWRESPAWN) || sv_singleplayerrespawn) && state == PST_REBORN && oldactor != NULL) + else if ((multiplayer || (level.flags2 & LEVEL2_ALLOWRESPAWN) || sv_singleplayerrespawn || + !!G_SkillProperty(SKILLP_PlayerRespawn)) && state == PST_REBORN && oldactor != NULL) { // Special inventory handling for respawning in coop p->mo->FilterCoopRespawnInventory (oldactor); } diff --git a/wadsrc/static/zscript/constants.txt b/wadsrc/static/zscript/constants.txt index dc4483253..e35af3a80 100644 --- a/wadsrc/static/zscript/constants.txt +++ b/wadsrc/static/zscript/constants.txt @@ -962,6 +962,7 @@ enum ESkillProperty SKILLP_EasyKey, SKILLP_SlowMonsters, SKILLP_Infight, + SKILLP_PlayerRespawn, }; enum EFSkillProperty // floating point properties {