From af7648a151a73e12fa0a10e6595b2517cadb4d63 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 3 Feb 2018 16:26:49 +0200 Subject: [PATCH] Made PlayerRespawn skill definition consistent Now it works the same as AllowRespawn map definition in MAPINFO --- src/g_level.cpp | 3 ++- wadsrc/static/zscript/shared/player.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index 17f76a67d0..d6c712b241 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -648,7 +648,8 @@ 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 || sv_singleplayerrespawn) && !deathmatch && player->playerstate == PST_DEAD) + if ((multiplayer || level.flags2 & LEVEL2_ALLOWRESPAWN || sv_singleplayerrespawn || !!G_SkillProperty(SKILLP_PlayerRespawn)) + && !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 diff --git a/wadsrc/static/zscript/shared/player.txt b/wadsrc/static/zscript/shared/player.txt index d43a59ce27..8ecce11cb2 100644 --- a/wadsrc/static/zscript/shared/player.txt +++ b/wadsrc/static/zscript/shared/player.txt @@ -528,7 +528,7 @@ class PlayerPawn : Actor native if (level.time >= player.respawn_time || ((player.cmd.buttons & BT_USE) && player.Bot == NULL)) { player.cls = NULL; // Force a new class if the player is using a random class - player.playerstate = (multiplayer || (level.AllowRespawn) || sv_singleplayerrespawn)? PST_REBORN : PST_ENTER; + player.playerstate = (multiplayer || level.AllowRespawn || sv_singleplayerrespawn || G_SkillPropertyInt(SKILLP_PlayerRespawn)) ? PST_REBORN : PST_ENTER; if (special1 > 2) { special1 = 0;