From ea8dca206f84ca564f939ac0a80c14dfa05e9fe0 Mon Sep 17 00:00:00 2001 From: Roel Date: Tue, 19 Feb 2019 17:24:07 +0100 Subject: [PATCH] fixed issue involving cooldown not working properly for weapons with long bursts --- Assemblies/DualWield.dll | Bin 75264 -> 75264 bytes Source/DualWield/Harmony/Jobdriver_Wait.cs | 4 +++- Source/DualWield/Harmony/RunAndGun.cs | 22 --------------------- Source/DualWield/Harmony/Verb.cs | 2 +- 4 files changed, 4 insertions(+), 24 deletions(-) diff --git a/Assemblies/DualWield.dll b/Assemblies/DualWield.dll index 77772aa3ea559c74a857df39fe7dbdacf109f0b1..20cc733e643f2c47a9c82c3d65f658f060f1ee96 100644 GIT binary patch delta 6774 zcmb7}d3;n=mdDSnS6iy;)vJ0{2_#h{6%r&X1jqsc8e~Vh5s54fXkrkd1tFlw>I)qp zY}&+P7bWS0F|;@mBLa#h5fm9kS)#)hNG8alKo-$}5twt&dxX^dF*BXdr@nQ5_jm3+ z_q?UHi{YJlTrSMGLjDj_t*o}gn39Ku->0io}&}01= z@V{aB(18Iit^~;a0Dx^`;ViBE3Ej$GPme{fCx8=liw*-=V!{B7T`UQas$8@X#}eG_ zgv??hF(sab*vtvRV4O9DVTM^p&p0Z^2dS|b4?%I|A*q&dw#Oftv5v+0D>A~$&t;4c zVTa07Uf5|-MmZP^aEx)d;FZvE$P^oAnaKHBEN5l-)5u%I;qg4qvrR>=7CCb$eud&* zL42euakZ1j*~D+V@wk$Bm3WqzZyhJ2G2hC|M7n1po9!?8XU*#r+A4*>wzyV_!7X_a zZt=O~<;Y>lYyCUsbr&~ayt>QV$hd@Jf8D$srPPrMe>d-Tgur6hgRBuaKQ-(}<{LRB z6Xz1*7ep}gkLbHY%`3n6hbBBq?Jt$|Ena8n|xlrKw%MAM!e0rYBG!Q4# zw6W|n94{fBCq}Tt4kO%%FGbGP9YcEM@0k%&eSADi{~2;wwYte zF!G%H1!6Gf1sJ@Ll!*CLkqo}pryP{eod@Gal_7>v`1ETM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XfHgnuZuVF9da e|B(=u&b+D2x!>YucSPaBi2b%m*1}2?^#2X7ML665 diff --git a/Source/DualWield/Harmony/Jobdriver_Wait.cs b/Source/DualWield/Harmony/Jobdriver_Wait.cs index fe774da..e6d6ad2 100644 --- a/Source/DualWield/Harmony/Jobdriver_Wait.cs +++ b/Source/DualWield/Harmony/Jobdriver_Wait.cs @@ -9,6 +9,7 @@ namespace DualWield.Harmony { + [HarmonyPatch(typeof(JobDriver_Wait), "CheckForAutoAttack")] public class Jobdriver_Wait_CheckForAutoAttack { @@ -30,12 +31,13 @@ static IEnumerable Transpiler(IEnumerable inst } public static bool FullBodyAndOffHandBusy(Pawn_StanceTracker instance) { - if(instance.pawn.GetStancesOffHand() is Pawn_StanceTracker stOffHand) + if(instance.pawn.GetStancesOffHand() is Pawn_StanceTracker stOffHand && instance.pawn.equipment != null && instance.pawn.equipment.TryGetOffHandEquipment(out ThingWithComps twc)) { return stOffHand.FullBodyBusy && instance.FullBodyBusy; } return instance.FullBodyBusy; } } + } diff --git a/Source/DualWield/Harmony/RunAndGun.cs b/Source/DualWield/Harmony/RunAndGun.cs index 572f70b..b4ad40a 100644 --- a/Source/DualWield/Harmony/RunAndGun.cs +++ b/Source/DualWield/Harmony/RunAndGun.cs @@ -38,28 +38,6 @@ static void Postfix(Pawn_StanceTracker stanceTracker, Stance_Cooldown stance) //SetStanceOffHand(stanceTracker, stance); Verb_TryCastNextBurstShot.SetStanceOffHand(stanceTracker, stance); } - /* - static void SetStanceOffHand(Pawn_StanceTracker stanceTracker, Stance_Cooldown stance) - { - ThingWithComps offHandEquip = null; - CompEquippable compEquippable = null; - Log.Message("calling RunAndGun.SetStanceOffHand"); - if (stanceTracker.pawn.equipment != null && stanceTracker.pawn.equipment.TryGetOffHandEquipment(out ThingWithComps result) && result != stanceTracker.pawn.equipment.Primary) - { - offHandEquip = result; - compEquippable = offHandEquip.TryGetComp(); - } - //Check if verb is one from a offhand weapon. - if (compEquippable != null && stance.verb == compEquippable.PrimaryVerb && stanceTracker.pawn.GetStancesOffHand().curStance is Stance_Warmup_DW) - { - Log.Message("found offhand verb!, setting offhand stance cooldown"); - Log.Message("Stance.type: " + stance.GetType().Name); - Log.Message("Stance.ticks: " + stance.ticksLeft); - stanceTracker.pawn.GetStancesOffHand().SetStance(stance); - } - } - */ - //When Run and Gun or the to be patched method isn't found, patch this stub method so no error is thrown. public static void Stub(Pawn_StanceTracker stanceTracker, Stance_Cooldown stance) diff --git a/Source/DualWield/Harmony/Verb.cs b/Source/DualWield/Harmony/Verb.cs index 2ae7ee1..2a8eec4 100644 --- a/Source/DualWield/Harmony/Verb.cs +++ b/Source/DualWield/Harmony/Verb.cs @@ -61,7 +61,7 @@ public static void SetStanceOffHand(Pawn_StanceTracker stanceTracker, Stance_Co { stanceTracker.pawn.GetStancesOffHand().SetStance(stance); } - else if (!(stanceTracker.curStance is Stance_Cooldown) && stanceTracker.curStance.GetType().Name != "Stance_RunAndGun_Cooldown") + else if (stanceTracker.curStance.GetType().Name != "Stance_RunAndGun_Cooldown") { stanceTracker.SetStance(stance); }