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".
This commit is contained in:
VMSolidus
2026-06-03 18:20:24 +00:00
committed by GitHub
parent cf585ef505
commit bf1196e6f1
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -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)