Vanilla-Expanded / VanillaExpandedFramework

Vanilla Expanded Framework for RimWorld
Other
74 stars 37 forks source link

[OPToxic] Obsolete StatDefOf.ToxicResistance #90

Open BlueEagle421 opened 7 months ago

BlueEagle421 commented 7 months ago

OPToxicGas class in OPToxic namespace currently uses StatDefOf.ToxicResistance to determine hediff.Severity multiplier. In 1.4 ToxicEnvironmentResistance StatDef was introduced for toxic gases and other toxic environmental damage. Seems more suitable to use that def instead.

ToxicResistance is related only to toxic fallout and seems obsolete for this use case.

In method DoOPToxicGas the severity multiplier could be calculated like this:

float multiplier = 1f - pawn.GetStatValue(StatDefOf.ToxicEnvironmentResistance);

Instead of:

float multiplier = 1f - pawn.GetStatValue(StatDefOf.ToxicResistance);