private static bool PrepForMapGen_ScenPartExSupport()
 {
     HarmonyMethods.PrepForMapGen();
     return(true);
 }
        private static void TryGenerateNewPawnInternal_ScenPartExSupport(ref PawnGenerationRequest request, ref string error, bool ignoreScenarioRequirements, ref Pawn __result)
        {
            if (__result == null)
            {
                return;
            }

            var pgsType = typeof(PawnGenerator).GetNestedType("PawnGenerationStatus", System.Reflection.BindingFlags.NonPublic);

            pawnsBeingGenerated.Add(Activator.CreateInstance(pgsType, new[] { __result, null }));
            try
            {
                if (!ignoreScenarioRequirements && request.Context == PawnGenerationContext.NonPlayer && Find.Scenario != null && !HarmonyMethods.AllowWorldStartingPawn(__result, false, request))
                {
                    discardGeneratedPawn(__result);
                    error    = "World Generated pawn doesn't meet scenario requirements.";
                    __result = null;
                }
            }
            finally
            {
                pawnsBeingGenerated.RemoveAt(pawnsBeingGenerated.Count - 1);
            }

            var opts = __result.GetComp <PawnCreationOptions>();

            opts.Request = request;
        }
 private static bool GeneratePawn_ScenPartExSupport(ref PawnGenerationRequest request)
 {
     HarmonyMethods.BeforeGeneratePawn(ref request);
     return(true);
 }