This commit is contained in:
Anuken
2025-12-29 11:00:47 -05:00
parent 7416bc3bb7
commit c1058ec351

View File

@@ -426,6 +426,8 @@ public class Weapon implements Cloneable{
Vars.control.sound.loop(activeSound, unit, activeSoundVolume);
}
float velLen = unit.isRemote() ? unit.vel.len() : unit.deltaLen() / Time.delta;
//shoot if applicable
if(mount.shoot && //must be shooting
can && //must be able to shoot
@@ -433,7 +435,7 @@ public class Weapon implements Cloneable{
(!useAmmo || unit.ammo > 0 || !state.rules.unitAmmo || unit.team.rules().infiniteAmmo) && //check ammo
(!alternate || wasFlipped == flipSprite) &&
mount.warmup >= minWarmup && //must be warmed up
unit.deltaLen() / Time.delta >= minShootVelocity && //check velocity requirements
velLen >= minShootVelocity && //check velocity requirements
(mount.reload <= 0.0001f || (alwaysContinuous && mount.bullet == null)) && //reload has to be 0, or it has to be an always-continuous weapon
(alwaysShooting || Angles.within(rotate ? mount.rotation : unit.rotation + baseRotation, mount.targetRotation, shootCone)) //has to be within the cone
){