mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge pull request #1344 from MellowArpeggiation/master
Fix centered weapons erroneously gaining the ADS accuracy boost
This commit is contained in:
commit
8d86ebb857
@ -111,12 +111,20 @@ public class EntityBulletBaseNT extends EntityThrowableInterp implements IBullet
|
||||
|
||||
ItemStack gun = entity.getHeldItem();
|
||||
boolean offsetShot = true;
|
||||
boolean accuracyBoost = false;
|
||||
|
||||
if(gun != null && gun.getItem() instanceof ItemGunBase) {
|
||||
GunConfiguration cfg = ((ItemGunBase) gun.getItem()).mainConfig;
|
||||
|
||||
if(cfg != null && (cfg.hasSights && entity.isSneaking()) || cfg.isCentered) {
|
||||
offsetShot = false;
|
||||
|
||||
if(cfg != null) {
|
||||
if(cfg.hasSights && entity.isSneaking()) {
|
||||
offsetShot = false;
|
||||
accuracyBoost = true;
|
||||
}
|
||||
|
||||
if(cfg.isCentered){
|
||||
offsetShot = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -140,7 +148,7 @@ public class EntityBulletBaseNT extends EntityThrowableInterp implements IBullet
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
|
||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.0F, this.config.spread * (offsetShot ? 1F : 0.25F));
|
||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.0F, this.config.spread * (accuracyBoost ? 0.25F : 1F));
|
||||
}
|
||||
|
||||
public EntityBulletBaseNT(World world, int config, EntityLivingBase entity, EntityLivingBase target, float motion, float deviation) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user