Pawn Spawn Patch
This is a patch for a very specific failed Pawn.
This is a patch for a very specific failed Pawn.SpawnSetup state. A pawn may be spawned on the map with several components missing, leaving it broken or partially spawned. These can throw a few exceptions which in my case, was affecting pawn rendering and other draw calls.
It does no ticking, rendering, periodic scanning, pawn deletion, respawning, or normal lifecycle modification. It only reacts when Pawn.SpawnSetup throws and the pawn is spawned with null components. It then makes one call to RimWorld's own PawnComponentsUtility.AddComponentsForSpawn and rstores the missing spawn components. It will not erase logs so you can diagnose what caused the initial spawn failure.
This is simply a preventative safeguard. It cant fix already spawned pawns. You will likely just need to remove them from the map to fix any issues. However this patch should prevent a few cases where specific components are missing.
To be more specific, it does not fix all 'null' components on pawns. It mainly targets a missing pather and any other vanilla spawn-only components. It will not blindly repair every pawn that has a null field.