angleOffset is added twice in Weapon shoot (#9332)

This commit is contained in:
MEEPofFaith
2023-11-30 04:18:40 -08:00
committed by GitHub
parent 871209d880
commit 9bd494504e

View File

@@ -468,7 +468,7 @@ public class Weapon implements Cloneable{
bulletY = mountY + Angles.trnsy(weaponRotation, this.shootX + xOffset + xSpread, this.shootY + yOffset),
shootAngle = bulletRotation(unit, mount, bulletX, bulletY) + angleOffset,
lifeScl = bullet.scaleLife ? Mathf.clamp(Mathf.dst(bulletX, bulletY, mount.aimX, mount.aimY) / bullet.range) : 1f,
angle = angleOffset + shootAngle + Mathf.range(inaccuracy + bullet.inaccuracy);
angle = shootAngle + Mathf.range(inaccuracy + bullet.inaccuracy);
Entityc shooter = unit.controller() instanceof MissileAI ai ? ai.shooter : unit; //Pass the missile's shooter down to its bullets
mount.bullet = bullet.create(unit, shooter, unit.team, bulletX, bulletY, angle, -1f, (1f - velocityRnd) + Mathf.random(velocityRnd), lifeScl, null, mover, mount.aimX, mount.aimY);