Skip to content

Commit

Permalink
CVar 'mp_respawn_immunity_force_unset' new value (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaqtincha committed May 5, 2021
1 parent 5410944 commit 71db673
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab
| mp_legacy_bombtarget_touch | 1 | 0 | 1 | Legacy func_bomb_target touch. New one is more strict. <br/>`0` New behavior<br/>`1` Legacy behavior|
| mp_respawn_immunitytime | 0 | 0 | - | Specifies the players defense time after respawn. (in seconds).<br/>`0` disabled<br/>`>0.00001` time delay to remove protection |
| mp_respawn_immunity_effects | 1 | 0 | 1 | Enable effects on player spawn protection.<br/>`0` disabled<br/>`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.<br/>`0` disabled<br/>`1` enabled |
| mp_respawn_immunity_force_unset | 1 | 0 | 2 | Force unset spawn protection if the player doing any action.<br/>`0` disabled<br/>`1` when moving and attacking<br/>`2` only when attacking |
| mp_kill_filled_spawn | 1 | 0 | 1 | Kill the player in filled spawn before spawning some one else (Prevents players stucking in each other).<br />Only disable this if you have semiclip or other plugins that prevents stucking.<br/>`0` disabled<br/>`1` enabled |
| mp_allow_point_servercommand | 0 | 0 | 1 | Allow use of point_servercommand entities in map.<br/>`0` disallow<br/>`1` allow<br/>`NOTE`: Potentially dangerous for untrusted maps. |
| mp_hullbounds_sets | 1 | 0 | 1 | Sets mins/maxs hull bounds for the player.<br/>`0` disabled<br/>`1` enabled |
Expand Down
3 changes: 2 additions & 1 deletion dist/game.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ mp_respawn_immunity_effects 1

// Force unset spawn protection if the player doing any action.
// 0 - disabled
// 1 - enabled
// 1 - when moving and attacking
// 2 - only when attacking
//
// Default value: "1"
mp_respawn_immunity_force_unset 1
Expand Down
5 changes: 3 additions & 2 deletions regamedll/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4667,8 +4667,9 @@ void EXT_FUNC CBasePlayer::__API_HOOK(PreThink)()

#ifdef REGAMEDLL_ADD
auto protectStateCurrent = CSPlayer()->GetProtectionState();
if (protectStateCurrent == CCSPlayer::ProtectionSt_Expired || (respawn_immunity_force_unset.value &&
(protectStateCurrent == CCSPlayer::ProtectionSt_Active && (m_afButtonPressed & IN_ACTIVE))))
if (protectStateCurrent == CCSPlayer::ProtectionSt_Expired ||
(protectStateCurrent == CCSPlayer::ProtectionSt_Active &&
((respawn_immunity_force_unset.value == 1 && (m_afButtonPressed & IN_ACTIVE)) || (respawn_immunity_force_unset.value == 2 && (m_afButtonPressed & (IN_ATTACK | IN_ATTACK2))))))
{
RemoveSpawnProtection();
}
Expand Down

0 comments on commit 71db673

Please sign in to comment.