diff --git a/Source/CombatExtended/CombatExtended/Verbs/Verb_LaunchProjectileCE.cs b/Source/CombatExtended/CombatExtended/Verbs/Verb_LaunchProjectileCE.cs index c1102daf44..6f0b42eec3 100644 --- a/Source/CombatExtended/CombatExtended/Verbs/Verb_LaunchProjectileCE.cs +++ b/Source/CombatExtended/CombatExtended/Verbs/Verb_LaunchProjectileCE.cs @@ -33,6 +33,7 @@ public class Verb_LaunchProjectileCE : Verb protected float distance = 10f; public CompCharges compCharges = null; + public CompAmmoUser compAmmo = null; public CompFireModes compFireModes = null; public CompChangeableProjectile compChangeable = null; @@ -139,6 +140,8 @@ public float ShootingAccuracy public float SightsEfficiency => EquipmentSource?.GetStatValue(CE_StatDefOf.SightsEfficiency) ?? 1f; public virtual float SwayAmplitude => Mathf.Max(0, (4.5f - ShootingAccuracy) * (EquipmentSource?.GetStatValue(CE_StatDefOf.SwayFactor) ?? 1f)); + public virtual CompAmmoUser CompAmmo => compAmmo ??= EquipmentSource?.TryGetComp(); + public virtual ThingDef Projectile { get diff --git a/Source/CombatExtended/CombatExtended/Verbs/Verb_ShootCE.cs b/Source/CombatExtended/CombatExtended/Verbs/Verb_ShootCE.cs index 92bad73fa4..45d03ef540 100644 --- a/Source/CombatExtended/CombatExtended/Verbs/Verb_ShootCE.cs +++ b/Source/CombatExtended/CombatExtended/Verbs/Verb_ShootCE.cs @@ -31,8 +31,6 @@ public class Verb_ShootCE : Verb_LaunchProjectileCE public Vector3 drawPos; - private CompAmmoUser compAmmo; - #endregion #region Properties @@ -128,14 +126,7 @@ public float AimAngle // Whether our shooter is currently under suppressive fire private bool IsSuppressed => ShooterPawn?.TryGetComp()?.isSuppressed ?? false; - public CompAmmoUser CompAmmo - { - get - { - compAmmo ??= EquipmentSource?.TryGetComp(); - return compAmmo; - } - } + public override CompAmmoUser CompAmmo => base.CompAmmo; public override ThingDef Projectile => CompAmmo?.CurrentAmmo != null ? CompAmmo.CurAmmoProjectile : base.Projectile;