WARNING | Potentially stupid question incoming.
Right now, the code for HealthUtility.AdjustSeverity looks like this:
My goal is to change a null value to a specific body part.
Let's say, for instance, the brain. Just about everything in RimWorld has a brain, right?
I've tried to change: pawn.health.AddHediff(hediff, null, null) -----> pawn.health.AddHediff(hediff, BodyPartDef.defName("Brain"), null)
Alas, visual studio informs me that I am doing something silly and should fix it.
Any suggestions? Help would be greatly appreciated
Right now, the code for HealthUtility.AdjustSeverity looks like this:
Code Select
public static class HealthUtility
{
public static void AdjustSeverity(Pawn pawn, HediffDef hdDef, float sevOffset)
{
if (sevOffset == 0f)
{
return;
}
Hediff hediff = pawn.health.hediffSet.GetFirstHediffOfDef(hdDef);
if (hediff != null)
{
hediff.Severity += sevOffset;
}
else if (sevOffset > 0f)
{
hediff = HediffMaker.MakeHediff(hdDef, pawn, null);
hediff.Severity = sevOffset;
pawn.health.AddHediff(hediff, null, null);
}
}
}
My goal is to change a null value to a specific body part.
Let's say, for instance, the brain. Just about everything in RimWorld has a brain, right?
I've tried to change: pawn.health.AddHediff(hediff, null, null) -----> pawn.health.AddHediff(hediff, BodyPartDef.defName("Brain"), null)
Alas, visual studio informs me that I am doing something silly and should fix it.
Any suggestions? Help would be greatly appreciated