From bf1196e6f12fb826c250027a3a0909ddbd2c0f22 Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Wed, 3 Jun 2026 14:20:24 -0400 Subject: [PATCH] High Gun Skill Fix (#22587) This fixes a math error that caused sufficiently high firearms skill to wrap back around to less accurate guns. The fix is pretty simple, if the calculated dispersion (in degrees) is a negative number, it instead becomes 0. The dispersion math downstream of this effectively treats dispersion as a magnitude, meaning -15 degrees of dispersion was the same thing as 15 degrees, when the intended interaction was "Having -15 degrees of dispersion offsets the penalty from less accurate guns". --- code/modules/projectiles/gun.dm | 2 +- html/changelogs/hellfirejag-dispersion-fix.yml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 html/changelogs/hellfirejag-dispersion-fix.yml diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index eea1678057d..ee43a4339f2 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -461,7 +461,7 @@ ABSTRACT_TYPE(/obj/item/gun) break var/acc = burst_accuracy[min(i, burst_accuracy.len)] - accuracy_decrease - var/disp = dispersion[min(i, dispersion.len)] + dispersion_increase + var/disp = max(0, dispersion[min(i, dispersion.len)] + dispersion_increase) process_accuracy(projectile, user, target, acc, disp) if(pointblank) diff --git a/html/changelogs/hellfirejag-dispersion-fix.yml b/html/changelogs/hellfirejag-dispersion-fix.yml new file mode 100644 index 00000000000..89ff62f264c --- /dev/null +++ b/html/changelogs/hellfirejag-dispersion-fix.yml @@ -0,0 +1,4 @@ +author: Hellfirejag +delete-after: True +changes: + - bugfix: "Fixed negative dispersion (from high gun skill) sometimes wrapping back around to inaccurate guns again."