Closed SirMashedPotato closed 2 years ago
Realised while I was in the shower, my example above wouldn't actually work, so here's take 2.
if (!def.canInfectMechanoids)
{
if(pawn.def is AlienRace.ThingDef_AlienRace a)
{
if(!a.alienRace.compatibility.IsFlesh)
{
return false;
}
}
else
{
if(pawn.RaceProps.FleshType != FleshTypeDefOf.Normal)
{
return false;
}
}
}
Definitely sounds like something to look into, and by the surface as a good solution.
I did not know that HAR had race compatibility information, so that is something to look further into too.
Describe the bug Non-mechanoid pawns that don't use Normal flesh type can't be mutated, even if they aren't actually mechanoid in nature.
To Reproduce You try mutate a pawn that doesn't use the Normal flesh type, such as ESCP - Sloads. And they don't gain the mutagenic build-up hediff.
Expected behavior
Mutagen.CanInfect
should check HAR'scompatibility
fields, specificallyisFlesh
. If the pawn is flesh, then it doesn't return.Additional context https://github.com/Tachyonite/Pawnmorpher/blob/0dc196ce0b7900b2b41596669413015f4ebbef7b/Source/Pawnmorphs/Esoteria/TfSys/Mutagen.cs#L102
Changing it to something along the lines of this should fix it.