Vanilla-Expanded / VanillaExpandedFramework

Vanilla Expanded Framework for RimWorld
Other
69 stars 34 forks source link

[OPToxic] Obsolete StatDefOf.ToxicResistance #90

Open BlueEagle421 opened 5 months ago

BlueEagle421 commented 5 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);