diff --git a/cstrike/cfg/sourcemod/zombiereloaded/zombiereloaded.cfg b/cstrike/cfg/sourcemod/zombiereloaded/zombiereloaded.cfg index 574088a..0d559ae 100644 --- a/cstrike/cfg/sourcemod/zombiereloaded/zombiereloaded.cfg +++ b/cstrike/cfg/sourcemod/zombiereloaded/zombiereloaded.cfg @@ -572,8 +572,8 @@ zr_jumpboost_bhop_protect "1" zr_jumpboost_bhop_max "300" // This is the horizontal jump multiplier for when the max limit is exceeded. ['0.9' = 90% of the jumps original magnitude | '>1.0' = Redundant | Dependency: zr_jumpboost_bhop_protect&zr_jumpboost_bhop_max] -// Default: "0.9" -zr_jumpboost_bhop_reset "0.9" +// Default: "0.75" +zr_jumpboost_bhop_scale "0.75" // ---------------------------------------------------------------------------- diff --git a/src/zombiereloaded.sp b/src/zombiereloaded.sp index 99e0466..5e923d9 100644 --- a/src/zombiereloaded.sp +++ b/src/zombiereloaded.sp @@ -169,14 +169,6 @@ public OnConfigsExecuted() ClassOnModulesLoaded(); } -/** - * Client cookies just finished loading from the database. - */ -public OnClientCookiesCached() -{ - // Forward event to modules. -} - /** * Client is joining the server. * diff --git a/src/zr/cvars.inc b/src/zr/cvars.inc index 0667c57..6681f24 100644 --- a/src/zr/cvars.inc +++ b/src/zr/cvars.inc @@ -137,7 +137,7 @@ enum CvarsList Handle:CVAR_NAPALM_IGNITE, Handle:CVAR_JUMPBOOST_BHOP_PROTECT, Handle:CVAR_JUMPBOOST_BHOP_MAX, - Handle:CVAR_JUMPBOOST_BHOP_RESET, + Handle:CVAR_JUMPBOOST_BHOP_SCALE, Handle:CVAR_VOL, Handle:CVAR_VOL_UPDATE_INTERVAL, Handle:CVAR_VOL_TRIGGER_INTERVAL, @@ -413,7 +413,7 @@ CvarsCreate() // =========================== g_hCvarsList[CVAR_JUMPBOOST_BHOP_PROTECT] = CreateConVar("zr_jumpboost_bhop_protect", "1", "Prevent players from using forward jump boost multipliers to bunny hop."); g_hCvarsList[CVAR_JUMPBOOST_BHOP_MAX] = CreateConVar("zr_jumpboost_bhop_max", "300", "The maximum horizontal velocity a player can achieve before bunnyhop protection kicks in. [Dependency: zr_jumpboost_bhop_protect]"); - g_hCvarsList[CVAR_JUMPBOOST_BHOP_RESET] = CreateConVar("zr_jumpboost_bhop_reset", "0.9", "This is the horizontal jump multiplier for when the max limit is exceeded. ['0.9' = 90% of the jumps original magnitude | '>1.0' = Redundant | Dependency: zr_jumpboost_bhop_protect&zr_jumpboost_bhop_max]"); + g_hCvarsList[CVAR_JUMPBOOST_BHOP_SCALE] = CreateConVar("zr_jumpboost_bhop_scale", "0.75", "This is the horizontal jump multiplier for when the max limit is exceeded. ['0.75' = 75% of the jumps original magnitude | '>1.0' = Redundant | Dependency: zr_jumpboost_bhop_protect&zr_jumpboost_bhop_max]"); // =========================== diff --git a/src/zr/jumpboost.inc b/src/zr/jumpboost.inc index 36e4f2d..798e134 100644 --- a/src/zr/jumpboost.inc +++ b/src/zr/jumpboost.inc @@ -41,14 +41,15 @@ JumpBoostOnClientJumpPost(client) // Get client's current velocity. ToolsClientVelocity(client, vecVelocity, false); - // Protect against bunnyhop. - JumpBoostBHopProtect(vecVelocity, distancemultiplier); - // Apply multipliers to jump vector. vecVelocity[0] *= distancemultiplier; vecVelocity[1] *= distancemultiplier; vecVelocity[2] *= heightmultiplier; + // Protect against bunnyhop. + JumpBoostBHopProtect(vecVelocity, distancemultiplier); + + // Set new velocity. ToolsClientVelocity(client, vecVelocity, true, false); } @@ -78,10 +79,10 @@ stock JumpBoostBHopProtect(Float:vecVelocity[], Float:distancemultiplier) return; } - // If we are resetting the velocity, then set to 1.0 (normal jump) - new Float:bunnyhopreset = GetConVarFloat(g_hCvarsList[CVAR_JUMPBOOST_BHOP_RESET]); + // Now we must scale the jump. + new Float:bunnyhopscale = GetConVarFloat(g_hCvarsList[CVAR_JUMPBOOST_BHOP_SCALE]); // Scale with cvar value. - vecVelocity[0] /= (distancemultiplier / bunnyhopreset); - vecVelocity[1] /= (distancemultiplier / bunnyhopreset); + vecVelocity[0] *= (magnitude * bunnyhopscale) / magnitude; + vecVelocity[1] *= (magnitude * bunnyhopscale) / magnitude; }