diff --git a/README.md b/README.md
index 2e11b3c1..9c3ab5d1 100644
--- a/README.md
+++ b/README.md
@@ -70,6 +70,7 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
| mp_legacy_bombtarget_touch | 1 | 0 | 1 | Legacy func_bomb_target touch. New one is more strict.
`0` New behavior
`1` Legacy behavior|
| mp_respawn_immunitytime | 0 | 0 | - | Specifies the players defense time after respawn. (in seconds).
`0` disabled
`>0.00001` time delay to remove protection |
| mp_respawn_immunity_effects | 1 | 0 | 1 | Enable effects on player spawn protection.
`0` disabled
`1` enable (Use in conjunction with the cvar mp_respawn_immunitytime) |
+| mp_respawn_immunity_force_unset | 1 | 0 | 1 | Force unset spawn protection if the player doing any action.
`0` disabled
`1` enabled |
| mp_kill_filled_spawn | 1 | 0 | 1 | Kill the player in filled spawn before spawning some one else (Prevents players stucking in each other).
Only disable this if you have semiclip or other plugins that prevents stucking.
`0` disabled
`1` enabled |
| mp_allow_point_servercommand | 0 | 0 | 1 | Allow use of point_servercommand entities in map.
`0` disallow
`1` allow
`NOTE`: Potentially dangerous for untrusted maps. |
| mp_hullbounds_sets | 1 | 0 | 1 | Sets mins/maxs hull bounds for the player.
`0` disabled
`1` enabled |
diff --git a/dist/game.cfg b/dist/game.cfg
index 5c2e932f..21e0d183 100644
--- a/dist/game.cfg
+++ b/dist/game.cfg
@@ -243,6 +243,13 @@ mp_respawn_immunitytime "0"
// Default value: "1"
mp_respawn_immunity_effects 1
+// Force unset spawn protection if the player doing any action.
+// 0 - disabled
+// 1 - enabled
+//
+// Default value: "1"
+mp_respawn_immunity_force_unset 1
+
// Kill the player in filled spawn before spawning some one else (Prevents players stucking in each other).
// Only disable this if you have semiclip or other plugins that prevents stucking
// 0 - disabled
diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp
index 5103aaa4..e958ff14 100644
--- a/regamedll/dlls/game.cpp
+++ b/regamedll/dlls/game.cpp
@@ -119,25 +119,26 @@ cvar_t fraglimit = { "mp_fraglimit", "0", FCVAR_SERVER, 0.0f, nullpt
cvar_t round_restart_delay = { "mp_round_restart_delay", "5", FCVAR_SERVER, 0.0f, nullptr };
cvar_t showtriggers = { "showtriggers", "0", 0, 0.0f, nullptr }; // debug cvar shows triggers
// TODO: Maybe it's better to register in the engine?
-cvar_t hostagehurtable = { "mp_hostage_hurtable", "1", FCVAR_SERVER, 1.0f, nullptr };
-cvar_t roundover = { "mp_roundover", "0", FCVAR_SERVER, 0.0f, nullptr };
-cvar_t forcerespawn = { "mp_forcerespawn", "0", FCVAR_SERVER, 0.0f, nullptr };
-cvar_t show_radioicon = { "mp_show_radioicon", "1", 0, 1.0f, nullptr };
-cvar_t show_scenarioicon = { "mp_show_scenarioicon", "0", FCVAR_SERVER, 0.0f, nullptr };
-cvar_t old_bomb_defused_sound = { "mp_old_bomb_defused_sound", "1", 0, 1.0f, nullptr };
-cvar_t item_staytime = { "mp_item_staytime", "300", FCVAR_SERVER, 300.0f, nullptr };
-cvar_t legacy_bombtarget_touch = { "mp_legacy_bombtarget_touch", "1", 0, 1.0f, nullptr };
-cvar_t respawn_immunitytime = { "mp_respawn_immunitytime", "0", FCVAR_SERVER, 0.0f, nullptr };
-cvar_t respawn_immunity_effects = { "mp_respawn_immunity_effects", "1", FCVAR_SERVER, 0.0f, nullptr };
-cvar_t kill_filled_spawn = { "mp_kill_filled_spawn", "1", 0, 0.0f, nullptr };
-cvar_t afk_bomb_drop_time = { "mp_afk_bomb_drop_time", "0", FCVAR_SERVER, 0.0f, nullptr };
-cvar_t buy_anywhere = { "mp_buy_anywhere", "0", FCVAR_SERVER, 0.0f, nullptr };
-cvar_t give_player_c4 = { "mp_give_player_c4", "1", FCVAR_SERVER, 0.0f, nullptr };
-cvar_t weapons_allow_map_placed = { "mp_weapons_allow_map_placed", "1", FCVAR_SERVER, 0.0f, nullptr };
+cvar_t hostagehurtable = { "mp_hostage_hurtable", "1", FCVAR_SERVER, 1.0f, nullptr };
+cvar_t roundover = { "mp_roundover", "0", FCVAR_SERVER, 0.0f, nullptr };
+cvar_t forcerespawn = { "mp_forcerespawn", "0", FCVAR_SERVER, 0.0f, nullptr };
+cvar_t show_radioicon = { "mp_show_radioicon", "1", 0, 1.0f, nullptr };
+cvar_t show_scenarioicon = { "mp_show_scenarioicon", "0", FCVAR_SERVER, 0.0f, nullptr };
+cvar_t old_bomb_defused_sound = { "mp_old_bomb_defused_sound", "1", 0, 1.0f, nullptr };
+cvar_t item_staytime = { "mp_item_staytime", "300", FCVAR_SERVER, 300.0f, nullptr };
+cvar_t legacy_bombtarget_touch = { "mp_legacy_bombtarget_touch", "1", 0, 1.0f, nullptr };
+cvar_t respawn_immunitytime = { "mp_respawn_immunitytime", "0", FCVAR_SERVER, 0.0f, nullptr };
+cvar_t respawn_immunity_effects = { "mp_respawn_immunity_effects", "1", FCVAR_SERVER, 0.0f, nullptr };
+cvar_t respawn_immunity_force_unset = { "mp_respawn_immunity_force_unset", "1", FCVAR_SERVER, 0.0f, nullptr };
+cvar_t kill_filled_spawn = { "mp_kill_filled_spawn", "1", 0, 0.0f, nullptr };
+cvar_t afk_bomb_drop_time = { "mp_afk_bomb_drop_time", "0", FCVAR_SERVER, 0.0f, nullptr };
+cvar_t buy_anywhere = { "mp_buy_anywhere", "0", FCVAR_SERVER, 0.0f, nullptr };
+cvar_t give_player_c4 = { "mp_give_player_c4", "1", FCVAR_SERVER, 0.0f, nullptr };
+cvar_t weapons_allow_map_placed = { "mp_weapons_allow_map_placed", "1", FCVAR_SERVER, 0.0f, nullptr };
-cvar_t allow_point_servercommand = { "mp_allow_point_servercommand", "0", 0, 0.0f, nullptr };
-cvar_t hullbounds_sets = { "mp_hullbounds_sets", "1", 0, 0.0f, nullptr };
-cvar_t unduck_method = { "mp_unduck_method", "0", 0, 0.0f, nullptr };
+cvar_t allow_point_servercommand = { "mp_allow_point_servercommand", "0", 0, 0.0f, nullptr };
+cvar_t hullbounds_sets = { "mp_hullbounds_sets", "1", 0, 0.0f, nullptr };
+cvar_t unduck_method = { "mp_unduck_method", "0", 0, 0.0f, nullptr };
cvar_t ff_damage_reduction_bullets = { "ff_damage_reduction_bullets", "0.35", FCVAR_SERVER, 0.0f, nullptr };
cvar_t ff_damage_reduction_grenade = { "ff_damage_reduction_grenade", "0.25", FCVAR_SERVER, 0.0f, nullptr };
@@ -341,6 +342,7 @@ void EXT_FUNC GameDLLInit()
CVAR_REGISTER(&legacy_bombtarget_touch);
CVAR_REGISTER(&respawn_immunitytime);
CVAR_REGISTER(&respawn_immunity_effects);
+ CVAR_REGISTER(&respawn_immunity_force_unset);
CVAR_REGISTER(&kill_filled_spawn);
CVAR_REGISTER(&afk_bomb_drop_time);
CVAR_REGISTER(&buy_anywhere);
diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h
index 0ed8c46b..f2be670d 100644
--- a/regamedll/dlls/game.h
+++ b/regamedll/dlls/game.h
@@ -158,6 +158,7 @@ extern cvar_t item_staytime;
extern cvar_t legacy_bombtarget_touch;
extern cvar_t respawn_immunitytime;
extern cvar_t respawn_immunity_effects;
+extern cvar_t respawn_immunity_force_unset;
extern cvar_t kill_filled_spawn;
extern cvar_t afk_bomb_drop_time;
extern cvar_t buy_anywhere;
diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp
index 90218103..79a204f6 100644
--- a/regamedll/dlls/player.cpp
+++ b/regamedll/dlls/player.cpp
@@ -4504,8 +4504,8 @@ void EXT_FUNC CBasePlayer::__API_HOOK(PreThink)()
#ifdef REGAMEDLL_ADD
auto protectStateCurrent = CSPlayer()->GetProtectionState();
- if (protectStateCurrent == CCSPlayer::ProtectionSt_Expired ||
- (protectStateCurrent == CCSPlayer::ProtectionSt_Active && (m_afButtonPressed & IN_ACTIVE)))
+ if (protectStateCurrent == CCSPlayer::ProtectionSt_Expired || (respawn_immunity_force_unset.value &&
+ (protectStateCurrent == CCSPlayer::ProtectionSt_Active && (m_afButtonPressed & IN_ACTIVE))))
{
RemoveSpawnProtection();
}