From af95dd81248b0800c66e90ffde295a43944c1df8 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Tue, 7 Apr 2020 03:04:31 +0200 Subject: [PATCH] Cstrike: Fix P228 firing bug --- src/shared/cstrike/w_p228.c | 2 +- src/shared/cstrike/weapons_cstrike.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/shared/cstrike/w_p228.c b/src/shared/cstrike/w_p228.c index 7bfac54d..57e5ac43 100644 --- a/src/shared/cstrike/w_p228.c +++ b/src/shared/cstrike/w_p228.c @@ -114,7 +114,7 @@ w_p228_primary(void) return; } #else - if (!pl.p90_mag) { + if (!pl.p228_mag) { return; } #endif diff --git a/src/shared/cstrike/weapons_cstrike.c b/src/shared/cstrike/weapons_cstrike.c index b7a91ae0..5acf788f 100644 --- a/src/shared/cstrike/weapons_cstrike.c +++ b/src/shared/cstrike/weapons_cstrike.c @@ -14,6 +14,20 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/* + * How Counter-Strike's accuracy works (from my understanding) + * this was deducted from the decrypted CS:S script files: + * https://gamebanana.com/gamefiles/2293 + * + * Each and every bullet fired contributes to the shotmultiplier value, + * which decreases back to 0 slowly over time. + * + * Meanwhile, accuracy gets calculated by taking said value and dividing it + * by the weapon-specific divider. Each gun has a different one. + * The higher the divider value, the more accurate the weapon is in contrast + * to other weapons. +*/ + /* called whenever a cstrike gun fires a successful shot */ void Cstrike_ShotMultiplierAdd(player pl, int shots)