Implemented cvar mp_unduck_method for prevent unduck if ducking isn't finished yet (also affects double duck)

This commit is contained in:
s1lent 2019-09-05 00:33:24 +07:00
parent 5e235a9851
commit 8ec88f804d
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
5 changed files with 30 additions and 1 deletions

View File

@ -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).<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_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_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 |
| mp_unduck_method | 0 | 0 | 1 | Don't unduck if ducking isn't finished yet.<br/>`0` disabled<br/>`1` enabled<br/>`NOTE`: This also prevents double duck. |
| mp_scoreboard_showhealth | 3 | 0 | 5 | Show `HP` field into a scoreboard.<br/>`0` don't send any update for `HP` field to any clients<br/>`1` show only Terrorist `HP` field to all clients<br/>`2` show only CT `HP` field to all clients<br/>`3` show `HP` field to teammates<br/>`4` show `HP` field to all clients<br/>`5` show `HP` field to teammates and spectators<br/><br/>`Note this CVar are work in beta only.` |
| mp_scoreboard_showmoney | 3 | 0 | 5 | Show `Money` field into a scoreboard.<br/>`0` don't send any update for `Money` field to any clients<br/>`1` show only Terrorist `Money` field to all clients<br/>`2` show only CT `Money` field to all clients<br/>`3` show `Money` field to teammates<br/>`4` show `Money` field to all clients<br/>`5` show `Money` field to teammates and spectators<br/><br/>`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.<br/> Range is from `0` - `1` (with 1 being damage equal to what is done to an enemy) |

8
dist/game.cfg vendored
View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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;