diff --git a/README.md b/README.md index 4df82a68..410672d3 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,8 @@ This means that plugins that do binary code analysis (Orpheu for example) probab | mp_fadetoblack | 0 | 0 | 2 | Observer's screen will fade to black on kill event or permanent.
`0` No fade.
`1` Fade to black and won't be able to watch anybody.
`2` fade to black only on kill moment. | | mp_falldamage | 1 | 0 | 1 | Damage from falling.
`0` disabled
`1` enabled | | sv_allchat | 1 | 0 | 1 | Players can receive all other players text chat, team restrictions apply
`0` disabled
`1` enabled | +| sv_autobunnyhopping | 0 | 0 | 1 | Players automatically re-jump while holding jump button.
`0` disabled
`1` enabled | +| sv_enablebunnyhopping | 0 | 0 | 1 | Allow player speed to exceed maximum running speed.
`0` disabled
`1` enabled | ## How to install zBot for CS 1.6? diff --git a/dist/game.cfg b/dist/game.cfg index 175f8d80..32620147 100644 --- a/dist/game.cfg +++ b/dist/game.cfg @@ -462,3 +462,17 @@ mp_free_armor 0 // // Default value: "0" sv_allchat 0 + +// Players automatically re-jump while holding jump button. +// 0 - disabled (default behaviour) +// 1 - enabled +// +// Default value: "0" +sv_autobunnyhopping 0 + +// Allow player speed to exceed maximum running speed +// 0 - disabled (default behaviour) +// 1 - enabled +// +// Default value: "0" +sv_enablebunnyhopping 0 diff --git a/regamedll/dlls/API/CSPlayer.cpp b/regamedll/dlls/API/CSPlayer.cpp index e2d69608..6b11725f 100644 --- a/regamedll/dlls/API/CSPlayer.cpp +++ b/regamedll/dlls/API/CSPlayer.cpp @@ -539,6 +539,8 @@ void CCSPlayer::Reset() m_iWeaponInfiniteIds = 0; m_bCanShootOverride = false; m_bGameForcingRespawn = false; + m_bAutoBunnyHopping = false; + m_bMegaBunnyJumping = false; } void CCSPlayer::OnSpawn() diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index dbe9b9ae..de055fd7 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -159,6 +159,8 @@ cvar_t t_default_weapons_secondary = { "mp_t_default_weapons_secondary", " cvar_t t_default_weapons_primary = { "mp_t_default_weapons_primary", "", 0, 0.0f, nullptr }; cvar_t free_armor = { "mp_free_armor", "0", 0, 0.0f, nullptr }; cvar_t allchat = { "sv_allchat", "0", 0, 0.0f, nullptr }; +cvar_t sv_autobunnyhopping = { "sv_autobunnyhopping", "0", 0, 0.0f, nullptr }; +cvar_t sv_enablebunnyhopping = { "sv_enablebunnyhopping", "0", 0, 0.0f, nullptr }; void GameDLL_Version_f() { @@ -387,6 +389,8 @@ void EXT_FUNC GameDLLInit() CVAR_REGISTER(&t_default_weapons_primary); CVAR_REGISTER(&free_armor); CVAR_REGISTER(&allchat); + CVAR_REGISTER(&sv_autobunnyhopping); + CVAR_REGISTER(&sv_enablebunnyhopping); // print version CONSOLE_ECHO("ReGameDLL version: " APP_VERSION "\n"); diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index cc04e1c6..2f362c05 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -185,6 +185,8 @@ extern cvar_t t_default_weapons_secondary; extern cvar_t t_default_weapons_primary; extern cvar_t free_armor; extern cvar_t allchat; +extern cvar_t sv_autobunnyhopping; +extern cvar_t sv_enablebunnyhopping; #endif diff --git a/regamedll/pm_shared/pm_shared.cpp b/regamedll/pm_shared/pm_shared.cpp index b50fde66..75d4a490 100644 --- a/regamedll/pm_shared/pm_shared.cpp +++ b/regamedll/pm_shared/pm_shared.cpp @@ -2418,8 +2418,19 @@ void PM_Jump() return; } +#ifdef REGAMEDLL_API + const CCSPlayer* player = UTIL_PlayerByIndex(pmove->player_index + 1)->CSPlayer(); +#endif + // don't pogo stick - if (pmove->oldbuttons & IN_JUMP) + if (pmove->oldbuttons & IN_JUMP +#ifdef REGAMEDLL_ADD + && sv_autobunnyhopping.value <= 0.0 +#ifdef REGAMEDLL_API + && !player->m_bAutoBunnyHopping +#endif +#endif + ) { return; } @@ -2434,7 +2445,16 @@ void PM_Jump() // In the air now. pmove->onground = -1; - PM_PreventMegaBunnyJumping(); +#ifdef REGAMEDLL_ADD + if (sv_enablebunnyhopping.value <= 0.0 +#ifdef REGAMEDLL_API + && !player->m_bMegaBunnyJumping +#endif + ) +#endif + { + PM_PreventMegaBunnyJumping(); + } real_t fvel = Length(pmove->velocity); float fvol = 1.0f; diff --git a/regamedll/public/regamedll/API/CSPlayer.h b/regamedll/public/regamedll/API/CSPlayer.h index 5020585a..4bee3ce0 100644 --- a/regamedll/public/regamedll/API/CSPlayer.h +++ b/regamedll/public/regamedll/API/CSPlayer.h @@ -46,7 +46,9 @@ public: m_iWeaponInfiniteAmmo(0), m_iWeaponInfiniteIds(0), m_bCanShootOverride(false), - m_bGameForcingRespawn(false) + m_bGameForcingRespawn(false), + m_bAutoBunnyHopping(false), + m_bMegaBunnyJumping(false) { m_szModel[0] = '\0'; } @@ -125,6 +127,8 @@ public: int m_iWeaponInfiniteIds; bool m_bCanShootOverride; bool m_bGameForcingRespawn; + bool m_bAutoBunnyHopping; + bool m_bMegaBunnyJumping; }; // Inlines