From b88915ba188aa71e590544adfc19dd149e8096eb Mon Sep 17 00:00:00 2001 From: shavit Date: Mon, 15 Apr 2019 03:01:06 +0300 Subject: [PATCH] Added "force_groundkeys" style property. --- addons/sourcemod/configs/shavit-styles.cfg | 1 + addons/sourcemod/scripting/include/shavit.inc | 1 + addons/sourcemod/scripting/shavit-core.sp | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/sourcemod/configs/shavit-styles.cfg b/addons/sourcemod/configs/shavit-styles.cfg index 7dd613a6..b1770c94 100644 --- a/addons/sourcemod/configs/shavit-styles.cfg +++ b/addons/sourcemod/configs/shavit-styles.cfg @@ -42,6 +42,7 @@ "block_d" "0" // Block +moveright (D). "block_use" "0" // Block +use (E). "force_hsw" "0" // Force half-sideways gameplay. 1 for regular HSW and 2 for surf-HSW. + "force_groundkeys" "0" // Forces the above settings even while on ground. e.g. enabling this will not allow W/D or W/A prestrafing when playing styles that disable the keys. "block_pleft" "0" // Block +left. 2 to stop timer. "block_pright" "0" // Block +right. 2 to stop timer. "block_pstrafe" "0" // Prevent button inconsistencies (including +pstrafe). May have false positives when players lag. Will prevent some strafe hacks too. Set this to 2 to also stop the timer. diff --git a/addons/sourcemod/scripting/include/shavit.inc b/addons/sourcemod/scripting/include/shavit.inc index 2fb09475..1e9223c7 100644 --- a/addons/sourcemod/scripting/include/shavit.inc +++ b/addons/sourcemod/scripting/include/shavit.inc @@ -168,6 +168,7 @@ enum struct stylesettings_t bool bInaccessible; int iEnabled; bool bKZCheckpoints; + bool bForceKeysOnGround; } enum struct chatstrings_t diff --git a/addons/sourcemod/scripting/shavit-core.sp b/addons/sourcemod/scripting/shavit-core.sp index 8eaee899..98fd9838 100644 --- a/addons/sourcemod/scripting/shavit-core.sp +++ b/addons/sourcemod/scripting/shavit-core.sp @@ -1988,6 +1988,7 @@ bool LoadStyles() gA_StyleSettings[i].bInaccessible = view_as(kv.GetNum("inaccessible", false)); gA_StyleSettings[i].iEnabled = kv.GetNum("enabled", 1); gA_StyleSettings[i].bKZCheckpoints = view_as(kv.GetNum("kzcheckpoints", 0)); + gA_StyleSettings[i].bForceKeysOnGround = view_as(kv.GetNum("force_groundkeys", 0)); // if this style is disabled, we will force certain settings if(gA_StyleSettings[i].iEnabled <= 0) @@ -2484,7 +2485,7 @@ public Action OnPlayerRunCmd(int client, int &buttons, int &impulse, float vel[3 buttons &= ~IN_USE; } - if(iGroundEntity == -1) + if(iGroundEntity == -1 || gA_StyleSettings[gA_Timers[client].iStyle].bForceKeysOnGround) { if(gA_StyleSettings[gA_Timers[client].iStyle].bBlockW && ((buttons & IN_FORWARD) > 0 || vel[0] > 0.0)) {