Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new CVar mp_jump_height #1022

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ This means that plugins that do binary code analysis (Orpheu for example) probab
| mp_ammo_respawn_time | 20 | 0.0 | - | The respawn time for ammunition. |
| mp_vote_flags | km | 0 | - | Vote systems enabled in server.<br/>`0` voting disabled<br/>`k` votekick enabled via `vote` command<br/>`m` votemap enabled via `votemap` command |
| mp_votemap_min_time | 180 | 0.0 | - | Minimum seconds that must elapse on map before `votemap` command can be used. |
| mp_jump_height | 45 | 0.0 | - | Player jump height. |

</details>

Expand Down
5 changes: 5 additions & 0 deletions dist/game.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -620,3 +620,8 @@ mp_vote_flags "km"
//
// Default value: "180"
mp_votemap_min_time "180"

// Player jump height
//
// Default value: "48"
mp_jump_height "48"
SergeyShorokhov marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions regamedll/dlls/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ cvar_t deathmsg_flags = { "mp_deathmsg_flags", "abc", 0, 0.0f
cvar_t assist_damage_threshold = { "mp_assist_damage_threshold", "40", 0, 40.0f, nullptr };
cvar_t freezetime_duck = { "mp_freezetime_duck", "1", 0, 1.0f, nullptr };
cvar_t freezetime_jump = { "mp_freezetime_jump", "1", 0, 1.0f, nullptr };
cvar_t jump_height = { "mp_jump_height", "45", FCVAR_SERVER, 45.0f, nullptr };

cvar_t hostages_rescued_ratio = { "mp_hostages_rescued_ratio", "1.0", 0, 1.0f, nullptr };

Expand Down Expand Up @@ -449,6 +450,7 @@ void EXT_FUNC GameDLLInit()

CVAR_REGISTER(&freezetime_duck);
CVAR_REGISTER(&freezetime_jump);
CVAR_REGISTER(&jump_height);
CVAR_REGISTER(&defuser_allocation);
CVAR_REGISTER(&location_area_info);
CVAR_REGISTER(&chat_loc_fallback);
Expand Down
1 change: 1 addition & 0 deletions regamedll/dlls/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ extern cvar_t deathmsg_flags;
extern cvar_t assist_damage_threshold;
extern cvar_t freezetime_duck;
extern cvar_t freezetime_jump;
extern cvar_t jump_height;
extern cvar_t defuser_allocation;
extern cvar_t location_area_info;
extern cvar_t chat_loc_fallback;
Expand Down
4 changes: 2 additions & 2 deletions regamedll/dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,7 @@ void CBasePlayer::PackDeadPlayerItems()
{
DropShield();
#ifdef REGAMEDLL_ADD
if(iPackGun != GR_PLR_DROP_GUN_ALL)
if (iPackGun != GR_PLR_DROP_GUN_ALL)
#endif
{
bSkipPrimSec = true;
Expand Down Expand Up @@ -2186,7 +2186,7 @@ void EXT_FUNC CBasePlayer::__API_HOOK(Killed)(entvars_t *pevAttacker, int iGib)
{
CBasePlayer *pAttacker = CBasePlayer::Instance(pevAttacker);

if(pAttacker /*safety*/ && !pAttacker->IsBot() && pAttacker->m_iTeam != m_iTeam)
if (pAttacker /*safety*/ && !pAttacker->IsBot() && pAttacker->m_iTeam != m_iTeam)
{
if (pAttacker->HasShield())
killerHasShield = true;
Expand Down
4 changes: 2 additions & 2 deletions regamedll/pm_shared/pm_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2429,13 +2429,13 @@ inline real_t PM_JumpHeight(bool longjump)
#ifdef REGAMEDLL_API
if (longjump)
{
if(pmoveplayer->m_flLongJumpHeight > 0.0)
if (pmoveplayer->m_flLongJumpHeight > 0.0)
return pmoveplayer->m_flLongJumpHeight;
}
else if (pmoveplayer->m_flJumpHeight > 0.0)
return pmoveplayer->m_flJumpHeight;
#endif
return Q_sqrt(2.0 * 800.0f * (longjump ? 56.0f : 45.0f));
return Q_sqrt(2.0 * 800.0f * (longjump ? 56.0f : Q_max(jump_height.value, 0.0f)));
}

LINK_HOOK_VOID_CHAIN2(PM_Jump)
Expand Down
Loading