Skip to content

Commit

Permalink
Update Always Knock Down for new version
Browse files Browse the repository at this point in the history
  • Loading branch information
welles committed Sep 12, 2022
1 parent 95dabe8 commit 5bd7a4d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Patches/Combat/AlwaysKnockDown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
using BannerlordCheats.Settings;
using HarmonyLib;
using JetBrains.Annotations;
using SandBox.GameComponents;
using TaleWorlds.Core;
using TaleWorlds.MountAndBlade;

namespace BannerlordCheats.Patches.Combat
{
[HarmonyPatch(typeof(Mission), "DecideAgentKnockedByBlow")]
[HarmonyPatch(typeof(SandboxAgentApplyDamageModel), nameof(SandboxAgentApplyDamageModel.DecideAgentKnockedDownByBlow))]
public static class AlwaysKnockDown
{
[UsedImplicitly]
[HarmonyPostfix]
public static void DecideAgentKnockedByBlow(
ref Agent attacker,
ref Agent victim,
ref Agent attackerAgent,
ref Agent victimAgent,
ref AttackCollisionData collisionData,
ref WeaponComponentData attackerWeapon,
ref bool isInitialBlowShrugOff,
ref Blow blow)
{
try
{
if (attacker.IsPlayer()
if (attackerAgent.IsPlayer()
&& BannerlordCheatsSettings.Instance?.AlwaysKnockDown == true)
{
blow.BlowFlag &= ~BlowFlags.ShrugOff;
Expand Down

0 comments on commit 5bd7a4d

Please sign in to comment.