public static void ComputeRandomMentalState(this HediffComp_RandySpawnUponDeath comp) { if (!comp.ChosenItem.HasMentalStateParams) { return; } MentalStateDef msd = comp.GetWeightedRandomMentalState(); if (msd == null) { if (comp.MyDebug) { Log.Warning("ComputeRandomMentalState - found no MentalStateDef"); } return; } comp.RandomMS = msd; if (comp.MyDebug) { Log.Warning("ComputeRandomFaction - found:" + comp.RandomFaction?.GetCallLabel()); } }