The check for if the spread angle should be updated happens after the distance check, so the result is incorrect
p_p = (d < p_d) ? xy : p_p;
p_d = (d < p_d) ? d : p_d;
// FIX: this is going to be comparing the new p_d value so it is wrong but old behaviour
p_a = (d < p_d) ? spread_current.direction.asDegrees() : p_a;
The check for if the spread angle should be updated happens after the distance check, so the result is incorrect