code taken from tgstation's fix:
The new procedure goes as follow :
the click code goes on until its end (afterattack),
if there's enough energy in the gun cell, a selected mode shot is
chambered (laser, electrode, ...),
the attack/firing code does its things,
at the end of it, we check if the shot was spent (i.e the actual
"bullet" was send). If so, we draw on the gun cell the correct amount of
power. If not, we just discard the chambered shot.
code taken from tgstation's fix: The new procedure goes as follow : the click code goes on until its end (afterattack), if there's enough energy in the gun cell, a selected mode shot is chambered (laser, electrode, ...), the attack/firing code does its things, at the end of it, we check if the shot was spent (i.e the actual "bullet" was send). If so, we draw on the gun cell the correct amount of power. If not, we just discard the chambered shot.