Skip to content

Commit

Permalink
Housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
ViralReaction committed Aug 21, 2024
1 parent a94e918 commit 2081ac0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ private void RebuildArmorCache(Dictionary<BodyPartRecord, float> armorCache, Sta
armorCache.Clear();
float naturalArmor = SelPawnForGear.GetStatValue(stat);
List<Apparel> wornApparel = SelPawnForGear.apparel?.WornApparel;
var shield = wornApparel.FirstOrDefault(x => x is Apparel_Shield);
var shield = wornApparel.FirstOrDefault(x => x is Apparel_Shield);
foreach (BodyPartRecord part in SelPawnForGear.RaceProps.body.AllParts)
{
//TODO: 1.5 should be Neck
Expand All @@ -538,7 +538,7 @@ private void RebuildArmorCache(Dictionary<BodyPartRecord, float> armorCache, Sta
if (shield != null)
{
var shieldCoverage = shield.def.GetModExtension<ShieldDefExtension>().PartIsCoveredByShield(part, SelPawnForGear);
if(shieldCoverage)
if (shieldCoverage)
{
armorValue += shield.GetStatValue(stat);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ orderby t.seniority descending
if (shieldCoverage != null)
{
yield return new StatDrawEntry(StatCategoryDefOf.Apparel, "CE_Shield_Coverage".Translate(), ShieldDefExtension.GetShieldProtectedAreas(BodyDefOf.Human, this.def), "CE_Shield_Coverage_Desc".Translate(), 800, null);
}
}
yield break;
}
public override void DrawWornExtras()
Expand Down
8 changes: 4 additions & 4 deletions Source/CombatExtended/Harmony/Harmony_ThingDef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ internal static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruct
{
code[startIndex].opcode = OpCodes.Nop;
//code[endIndex].opcode = OpCodes.Nop;
code.RemoveRange(startIndex + 1, endIndex-startIndex-1);
code.Insert(startIndex+1, new CodeInstruction(OpCodes.Ldarg_0));
code.Insert(startIndex+2, new CodeInstruction(OpCodes.Ldloc_0));
code.Insert(startIndex+3, new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(ThingDef_DescriptionDetailed), "AddShieldCover", null, null)));
code.RemoveRange(startIndex + 1, endIndex - startIndex - 1);
code.Insert(startIndex + 1, new CodeInstruction(OpCodes.Ldarg_0));
code.Insert(startIndex + 2, new CodeInstruction(OpCodes.Ldloc_0));
code.Insert(startIndex + 3, new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(ThingDef_DescriptionDetailed), "AddShieldCover", null, null)));
}
foreach (var c in code)
{
Expand Down

0 comments on commit 2081ac0

Please sign in to comment.