From 2cc70879d2aa12a53c471eb411b3babc175de53c Mon Sep 17 00:00:00 2001 From: lbmaian Date: Fri, 30 Jul 2021 07:21:28 -0700 Subject: [PATCH] Workaround for mod lists that contain other mods with an outdated copy of CompOversizedWeapon that's loaded before ours: have CompActivatableEffect not reference new code in our version of CompOversizedWeapon --- 1.3/Assemblies/CompActivatableEffect.dll | Bin 16896 -> 16896 bytes .../HarmonyCompActivatableEffect.cs | 16 +++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/1.3/Assemblies/CompActivatableEffect.dll b/1.3/Assemblies/CompActivatableEffect.dll index 62dd4b5fe94dc07d3a17259d4d6e5dc4f65c2d9e..8a31d133b63986e005b5571dd85b7fecd0a35b4a 100644 GIT binary patch delta 4499 zcmaKw33OD|8OOhS@0+*H%*)Iq41^Fe$dXA2OMn0Yfdr*Cf-DCR14M`>EV6`}KE>#vQXe&5wXz_@3DF~L7x*&>zv`1`R=%KWT+WzmIIZE4eI%IzH{lD)n z-~H};cis@clg003o7QSS&7FO3+xjkiSY_Lu8=X&YBAP&W%_iC^+PY=>;zT~^BM5YH zyYV8olI8QVQg=05mEENh5xjnkHzyB8`w{IdAYyL$up!Bbe4z*qB+`5G=B`9q;mEx2 z8ips2dUkL&$gMYfv&rs*=ID|s=nx%1WN+`;@z@oj)3K>PM6$0GosUgTW?6sao@gR&*&o%xHu3Gy*|Ax(pwg zhSA4Z^%GdVJ*$>WzY+9=qqoB)}^>glm$whMxO2?xuZWn(QyW3sqkMv)QKu;sevG%3_ zqRp)-M+A=Mb;|xu&xdHZ2cmhsd)VLQKRRJUzweZHWvA#Box)BJw!t0l6pm`aCkCwt)IEP2mnPX^``A+A0??{9`pi>5qj&d(KFS3#D zGZ`~Oqu}LP&E3&3Y|G%)Zuh_pOdAUn7Jfgi8b?h#JUuNoRBM({(_Z5q4-||z;t+L5 zb%$o)>J7r4+_-f9;F?8NmM*zZafv6_mq`;*OP%(6ZZLG(svj_QDpUN{Bkj)0jw#-$ z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>9hzy1cM|ocHNF{OwmApOx4=7>Hq&HlA#G+YYzZ~6 zYTRu7s7d5ef5kXGY(GHFEXp^5>-kpdMEV`HhjqGl(IK|cx0jAF4}T5*I{PhnHaot| z9?=tQhjEh5uqyEn>ZCXQ7HgzxEyy})pqb9P*!NZ+*l&v~*+sTmD`MD6++1V-#y6nUAx4E{tbbBR_5J zM$1=x``K!>?#+CI{}1RjkR4|wY7a`-67MOtlwa@pGpm8ePhISvyo<#-Hk^13iyIcC z?dih~(LHuQ-obYJ^LZVc?JnXC?1D9dH?vHhiFNNO^5F@w2F$O&m_a*vg>@b8WjuOOYC;Ols)KP&3DqAsCOOj;w#LJ zd=GshwjwMK`AT+P-^nlXHh()v0omcK=QrR!^EvQabY`M0TWNi%3X4y8FXQH03@79|;?iCPgJkW<0Fv>Ys?HgFKV0}i8e;I(uC zyiswY@=pP;l_NyOc1mElkLeCjFv*ePc5=Cfd}2venKk;Lw;$0u3Zflxg?)rl^SmF@#1=j z9rhUTw0+a%w)1gTeYA}F;B+ddY;Xk5BTkiAXoF_KV_-vaz@I5k6Xn95OL^dY$_E!< zGfcV*Elpa2mL{!4OOs+~X;Ld%n$(7tCbgqwHWgDnt-?3x>zNjlCngR?=jCkou#;YS zTK@2=5{qztcDFc~Rf3;{@^ud9YqA%r?0#8}2_i}T#w5;yjgT&4JlJRw8l4En_PB`$t5v|` zXBzWok)1_cSd42H3-r|VKo{k7m%4M_w>o@X7!#(w}os3?R0 diff --git a/Source/AllModdingComponents/CompActivatableEffect/HarmonyCompActivatableEffect.cs b/Source/AllModdingComponents/CompActivatableEffect/HarmonyCompActivatableEffect.cs index c8d000b6..e5b6f851 100644 --- a/Source/AllModdingComponents/CompActivatableEffect/HarmonyCompActivatableEffect.cs +++ b/Source/AllModdingComponents/CompActivatableEffect/HarmonyCompActivatableEffect.cs @@ -123,7 +123,7 @@ public static void DrawEquipmentAimingPostFix(Pawn ___pawn, Thing eq, Vector3 dr var weaponComp = compActivatableEffect.GetOversizedWeapon; if (weaponComp != null) { - offset = weaponComp.Props.OffsetFromRotation(___pawn.Rotation); + offset = OffsetFromRotation(weaponComp.Props, ___pawn.Rotation); } if (compActivatableEffect.CompDeflectorIsAnimatingNow) @@ -147,6 +147,20 @@ public static void DrawEquipmentAimingPostFix(Pawn ___pawn, Thing eq, Vector3 dr Graphics.DrawMesh(flip ? MeshPool.plane10Flip : MeshPool.plane10, matrix, matSingle, 0); } + // Workaround for mod lists that contain other mods with an outdated copy of CompOversizedWeapon that's loaded before ours: + // avoid calling new code that's in our version. + private static Vector3 OffsetFromRotation(CompOversizedWeapon.CompProperties_OversizedWeapon weaponComp, Rot4 rotation) + { + if (rotation == Rot4.North) + return weaponComp.northOffset; + else if (rotation == Rot4.East) + return weaponComp.eastOffset; + else if (rotation == Rot4.West) + return weaponComp.westOffset; + else + return weaponComp.southOffset; + } + public static void GetGizmosPostfix(Pawn_EquipmentTracker __instance, ref IEnumerable __result) { if (__instance.Primary?.GetCompActivatableEffect() is CompActivatableEffect compActivatableEffect)