Skip to content

Commit

Permalink
Merge pull request #3262 from CombatExtended-Continued/BipodInjectorD…
Browse files Browse the repository at this point in the history
…e-HardcodeAttempt

enable custom verb on bipod injector
  • Loading branch information
N7Huntsman authored Jul 14, 2024
2 parents 2d4578b + 636ea48 commit 01dfc2f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/CombatExtended/Compatibility/Bipod_Injector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ public static void Add_and_change_all()
List<ThingDef> defs = DefDatabase<ThingDef>.AllDefsListForReading.FindAll(k => (k.weaponTags?.Any(O => O == bipod_def.bipod_id) ?? false) && (!k.Verbs?.Any(P => P.verbClass == typeof(CompProperties_BipodComp)) ?? false));
foreach (ThingDef def in defs)
{
if (def.Verbs?.Any(PP => PP.verbClass == typeof(Verb_ShootCE)) ?? false)
if (def.Verbs?.Any(PP => PP.verbClass == typeof(Verb_ShootCE) || PP.verbClass.IsSubclassOf(typeof(Verb_ShootCE))) ?? false)
{
var dar = def.Verbs.Find(PP => PP.verbClass == typeof(Verb_ShootCE)).MemberwiseClone();

var tempVP = def.Verbs.Find(PP => PP.verbClass == typeof(Verb_ShootCE) || PP.verbClass.IsSubclassOf(typeof(Verb_ShootCE)));
var dar = tempVP.MemberwiseClone();
if (dar != null)
{
dar.verbClass = typeof(Verb_ShootCE);
dar.verbClass = tempVP.verbClass;
def.Verbs.Clear();
def.comps.Add(new CompProperties_BipodComp { catDef = bipod_def, swayMult = bipod_def.swayMult, swayPenalty = bipod_def.swayPenalty, additionalrange = bipod_def.ad_Range, recoilMulton = bipod_def.recoil_mult_setup, recoilMultoff = bipod_def.recoil_mult_NOT_setup, ticksToSetUp = bipod_def.setuptime, warmupMult = bipod_def.warmup_mult_setup, warmupPenalty = bipod_def.warmup_mult_NOT_setup });
def.Verbs.Add(dar);
Expand Down

0 comments on commit 01dfc2f

Please sign in to comment.