diff --git a/README.md b/README.md
index 4ac51fd0..222b7453 100644
--- a/README.md
+++ b/README.md
@@ -62,8 +62,9 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
| 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_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_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 |
+| mp_unduck_method | 0 | 0 | 1 | Don't unduck if ducking isn't finished yet.
`0` disabled
`1` enabled
`NOTE`: This also prevents double duck. |
| mp_scoreboard_showhealth | 3 | 0 | 5 | Show `HP` field into a scoreboard.
`0` don't send any update for `HP` field to any clients
`1` show only Terrorist `HP` field to all clients
`2` show only CT `HP` field to all clients
`3` show `HP` field to teammates
`4` show `HP` field to all clients
`5` show `HP` field to teammates and spectators
`Note this CVar are work in beta only.` |
| mp_scoreboard_showmoney | 3 | 0 | 5 | Show `Money` field into a scoreboard.
`0` don't send any update for `Money` field to any clients
`1` show only Terrorist `Money` field to all clients
`2` show only CT `Money` field to all clients
`3` show `Money` field to teammates
`4` show `Money` field to all clients
`5` show `Money` field to teammates and spectators
`Note this CVar are work in beta only.` |
| ff_damage_reduction_bullets | 0.35 | 0.0 | 1.0 | How much to reduce damage done to teammates when shot.
Range is from `0` - `1` (with 1 being damage equal to what is done to an enemy) |
diff --git a/dist/game.cfg b/dist/game.cfg
index 8014805c..6f80f830 100644
--- a/dist/game.cfg
+++ b/dist/game.cfg
@@ -321,3 +321,11 @@ mp_radio_maxinround 60
//
// Default value: "0"
mp_buy_anywhere 0
+
+// Don't unduck if ducking isn't finished yet.
+// NOTE: This also prevents double duck.
+// 0 - disabled (default behaviour)
+// 1 - enabled
+//
+// Default value: "0"
+mp_unduck_method 0
diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp
index e959c772..ed4a94fc 100644
--- a/regamedll/dlls/game.cpp
+++ b/regamedll/dlls/game.cpp
@@ -126,6 +126,7 @@ cvar_t buy_anywhere = { "mp_buy_anywhere", "0", FCVAR_SERVER, 0.0f,
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 scoreboard_showmoney = { "mp_scoreboard_showmoney", "3", FCVAR_SERVER, 0.0f, nullptr };
cvar_t scoreboard_showhealth = { "mp_scoreboard_showhealth", "3", FCVAR_SERVER, 0.0f, nullptr };
@@ -326,6 +327,7 @@ void EXT_FUNC GameDLLInit()
CVAR_REGISTER(&buy_anywhere);
CVAR_REGISTER(&allow_point_servercommand);
CVAR_REGISTER(&hullbounds_sets);
+ CVAR_REGISTER(&unduck_method);
CVAR_REGISTER(&ff_damage_reduction_bullets);
CVAR_REGISTER(&ff_damage_reduction_grenade);
diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h
index f4ac3727..381376b6 100644
--- a/regamedll/dlls/game.h
+++ b/regamedll/dlls/game.h
@@ -162,6 +162,7 @@ extern cvar_t afk_bomb_drop_time;
extern cvar_t buy_anywhere;
extern cvar_t allow_point_servercommand;
extern cvar_t hullbounds_sets;
+extern cvar_t unduck_method;
extern cvar_t ff_damage_reduction_bullets;
extern cvar_t ff_damage_reduction_grenade;
extern cvar_t ff_damage_reduction_grenade_self;
diff --git a/regamedll/pm_shared/pm_shared.cpp b/regamedll/pm_shared/pm_shared.cpp
index 09b04b6c..77d483c1 100644
--- a/regamedll/pm_shared/pm_shared.cpp
+++ b/regamedll/pm_shared/pm_shared.cpp
@@ -1795,6 +1795,23 @@ void PM_FixPlayerCrouchStuck(int direction)
void PM_UnDuck()
{
+#ifdef REGAMEDLL_ADD
+ if (unduck_method.value)
+#endif
+ {
+#ifdef REGAMEDLL_FIXES
+ // if ducking isn't finished yet, so don't unduck
+ if (pmove->bInDuck || !(pmove->flags & FL_DUCKING))
+ {
+ pmove->usehull = 0;
+ pmove->flDuckTime = 0;
+ pmove->bInDuck = FALSE;
+ pmove->view_ofs[2] = PM_VEC_VIEW;
+ return;
+ }
+#endif // #ifdef REGAMEDLL_FIXES
+ }
+
pmtrace_t trace;
vec3_t newOrigin;