From af883ec922bc5ddba55f68b51cbc531b70b031bc Mon Sep 17 00:00:00 2001 From: sauerbraten Date: Fri, 4 Dec 2020 12:28:24 +0100 Subject: [PATCH] fix shotgun damage recording --- patches/scoreboard.patch | 2 +- src/fpsgame/weaponstats.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/scoreboard.patch b/patches/scoreboard.patch index 9b96dab..4163f89 100644 --- a/patches/scoreboard.patch +++ b/patches/scoreboard.patch @@ -669,7 +669,7 @@ Index: src/fpsgame/weaponstats.cpp + if(!shouldcountdamage(attacker, target)) return; + int gun = attacker->gunselect; + // try to fix gun used to deal the damage -+ if(gun == GUN_RL || gun == GUN_GL || damage != guns[gun].damage * (attacker->quadmillis ? 4 : 1)) ++ if((gun != GUN_SG && damage != guns[gun].damage * (attacker->quadmillis ? 4 : 1)) || (gun == GUN_SG && damage%(attacker->quadmillis ? 40 : 10) != 0)) + { + gun = attacker->stats.lastprojectile; + } diff --git a/src/fpsgame/weaponstats.cpp b/src/fpsgame/weaponstats.cpp index ee1e158..c2fe0ad 100644 --- a/src/fpsgame/weaponstats.cpp +++ b/src/fpsgame/weaponstats.cpp @@ -19,7 +19,7 @@ namespace game { if(!shouldcountdamage(attacker, target)) return; int gun = attacker->gunselect; // try to fix gun used to deal the damage - if(gun == GUN_RL || gun == GUN_GL || damage != guns[gun].damage * (attacker->quadmillis ? 4 : 1)) + if((gun != GUN_SG && damage != guns[gun].damage * (attacker->quadmillis ? 4 : 1)) || (gun == GUN_SG && damage%(attacker->quadmillis ? 40 : 10) != 0)) { gun = attacker->stats.lastprojectile; }