Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions About/About.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
<li>DankPyon.Medieval.Overhaul</li>
<li>vanillaquestsexpanded.deadlife</li>
<li>vanillaracesexpanded.android</li>
<li>UracosVereches.bettergrenadehandling</li>
</loadAfter>

</ModMetaData>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Reflection;
using HarmonyLib;
using Verse;

namespace CombatExtended.HarmonyCE.Compatibility;

public class Harmony_BetterGrenadeHandling //manually patched from HarmonyBase
{
internal static Type TypeOfBGHUtils
{
get
{
return AccessTools.TypeByName("BetterGrenadeHandling.BGHUtils");
}
}

public static bool Prefix(Thing target, ref bool __result)
{
Pawn targetPawn = target as Pawn;
__result = targetPawn?.stances?.stunner?.StunFromEMP == false;

return false;
}
}
13 changes: 13 additions & 0 deletions Source/CombatExtended/Harmony/HarmonyBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Reflection.Emit;
using System.Linq;
using System.Collections.Generic;
using CombatExtended.HarmonyCE.Compatibility;

/* Note to those unfamiliar with Reflection/Harmony (like me, ProfoundDarkness), operands have some specific types and it's useful to know these to make good patches (Transpiler).
* Below I'm noting the operators and what type of operand I've observed.
Expand Down Expand Up @@ -57,6 +58,18 @@ public static void InitPatches()
Harmony_GenRadial.Patch();
PawnColumnWorkers_Resize.Patch();
PawnColumnWorkers_SwapButtons.Patch();

// Patches that require being ran later into loading
LongEventHandler.ExecuteWhenFinished(() =>
{
if (Harmony_BetterGrenadeHandling.TypeOfBGHUtils == null)
{
return;
}

instance.Patch(AccessTools.Method(Harmony_BetterGrenadeHandling.TypeOfBGHUtils, "ShouldBeHitByEMP"),
prefix: new HarmonyMethod(typeof(Harmony_BetterGrenadeHandling).GetMethod("Prefix")));
});
}

#region Patch helper methods
Expand Down
1 change: 1 addition & 0 deletions SupportedThirdPartyMods.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Beeralope Squad |
Beliar Xenotype |
Beta Anime Hair |
Beta Girls und Panzer Hair and Apparel |
Better Grenade Handling |
Better Traders Guild |
Better Wool Production - C# Edition |
Big and Small - Genes & More |
Expand Down
Loading