Skip to content

Commit

Permalink
Merge pull request #2970 from CombatExtended-Continued/AdditionalFixes
Browse files Browse the repository at this point in the history
Additional Fixes for 5.6 Hotfix
  • Loading branch information
perkinslr authored Apr 1, 2024
2 parents 4d2da34 + 1768ff4 commit eae9169
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
</li>

<!-- == costList == -->
<li Class="PatchOperationReplace">
<xpath>Defs/ThingDef[defName="Turret_GatlingGun"]/costList</xpath>
<li Class="PatchOperationAdd">
<xpath>Defs/ThingDef[defName="Turret_GatlingGun"]</xpath>
<value>
<costList>
<Steel>325</Steel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public void AddSuppression(float amount, IntVec3 origin)
}
public bool IgnoreSuppresion(IntVec3 origin)
{
return BlockerRegistry.PawnUnsuppresableFromCallback(parent as Pawn, origin) || SuppressionUtility.InterceptorZonesFor((Pawn)parent).Where(x => x.Contains(parent.Position)).Any(x => !x.Contains(origin));
return BlockerRegistry.PawnUnsuppressableFromCallback(parent as Pawn, origin) || SuppressionUtility.InterceptorZonesFor((Pawn)parent).Where(x => x.Contains(parent.Position)).Any(x => !x.Contains(origin));
}

public override void CompTick()
Expand Down
10 changes: 5 additions & 5 deletions Source/CombatExtended/Compatibility/BlockerRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static class BlockerRegistry
private static List<Func<ProjectileCE, IntVec3, Thing, bool>> checkCellForCollisionCallbacks;
private static List<Func<ProjectileCE, Thing, bool>> impactSomethingCallbacks;
private static List<Func<ProjectileCE, Thing, bool>> beforeCollideWithCallbacks;
private static List<Func<Pawn, IntVec3, bool>> pawnUnsuppresableFromCallback;
private static List<Func<Pawn, IntVec3, bool>> pawnUnsuppressableFromCallback;
private static List<Func<Thing, IEnumerable<IEnumerable<IntVec3>>>> shieldZonesCallback;

private static void EnableCB()
Expand All @@ -47,7 +47,7 @@ private static void EnableSZ()
private static void EnablePUF()
{
enabledPUF = true;
pawnUnsuppresableFromCallback = new List<Func<Pawn, IntVec3, bool>>();
pawnUnsuppressableFromCallback = new List<Func<Pawn, IntVec3, bool>>();
}
private static void EnableBCW()
{
Expand Down Expand Up @@ -118,7 +118,7 @@ public static void RegisterUnsuppresableFromCallback(Func<Pawn, IntVec3, bool> f
{
EnablePUF();
}
pawnUnsuppresableFromCallback.Add(f);
pawnUnsuppressableFromCallback.Add(f);
}

public static bool CheckCellForCollisionCallback(ProjectileCE projectile, IntVec3 cell, Thing launcher)
Expand Down Expand Up @@ -159,13 +159,13 @@ public static IEnumerable<IEnumerable<IntVec3>> ShieldZonesCallback(Thing thing)
}
return shieldZonesCallback.SelectMany(cb => cb(thing));
}
public static bool PawnUnsuppresableFromCallback(Pawn pawn, IntVec3 origin)
public static bool PawnUnsuppressableFromCallback(Pawn pawn, IntVec3 origin)
{
if (!enabledPUF)
{
return false;
}
foreach (var cb in pawnUnsuppresableFromCallback)
foreach (var cb in pawnUnsuppressableFromCallback)
{
if (cb(pawn, origin))
{
Expand Down

0 comments on commit eae9169

Please sign in to comment.