private void RandomizeCurPawn() { if (!TutorSystem.AllowAction("RandomizePawn")) { return; } int num = 0; while (true) { this.curPawn = Page_ConfigureStartingSlaves.RandomizeInPlace(this.curPawn); num++; if (num > 15) { break; } if (StartingPawnUtility.WorkTypeRequirementsSatisfied()) { goto Block_3; } } return; Block_3: TutorSystem.Notify_Event("RandomizePawn"); }
public static Pawn RandomizeInPlace(Pawn p) { int index = Page_ConfigureStartingSlaves.StartingPawns.IndexOf(p); Pawn pawn = Page_ConfigureStartingSlaves.RegenerateStartingPawnInPlace(index); if (pawn.story.WorkTagIsDisabled(WorkTags.ManualDumb) || pawn.story.WorkTagIsDisabled(WorkTags.Violent)) { pawn = Page_ConfigureStartingSlaves.RegenerateStartingPawnInPlace(index); } return(pawn); }