vegapnk / RJW-Genes

Rimworld Biotech Genes related to RJW
MIT License
31 stars 33 forks source link

Using with SOS2 causes pawns invisible when walking in vacuum #120

Closed hayashi-tsukigin closed 2 weeks ago

hayashi-tsukigin commented 1 month ago

RJW Genes are thought to be the most likely cause of the bug by Visual Exceptions

Exception in Verse.TickList.Tick: System. NullReferenceException: Object reference not set to an instance of an object
[Ref C2820596]
at RJW_Genes.GeneUtility. OffsetLifeForce (RimWorld. IGeneResourceDrain drain, System. Single offset) [0x00000] in <15637142d2484a599d9836c99c68f62f>:0
at RJW_Genes.Gene_LifeForce_Empath. FarmLifeForce (Verse. Pawn farmedPawn) [0x0004f] in <15637142d2484a599d9836c99c68f62f>:0
at RJW_Genes.Gene_LifeForce_Empath. Tick () [0x00051] in <15637142d2484a599d9836c99c68f62f>:0
at RimWorld.Pawn_GeneTracker. GeneTrackerTick () [0x0003f] in <f0ac5eb9b52e4cc396c70fc9a4ee15e5>:0
at Verse.Pawn.Tick () [0x00678] in <f0ac5eb9b52e4cc396c70fc9a4ee15e5>:0
- TRANSPILER Krkr.RocketMan.Soyuz: IEnumerable`1 Soyuz.Patches. Pawn_Tick_Patch:Transpiler(IEnumerable`1 instructions, ILGenerator generator)
- PREFIX RIMMSqol: Boolean RIMMSqol.ThinkResultContextRecover:Prefix()
- POSTFIX alt4s. alliesarehelpful: Void PawnTendAndRescuePatch:Postfix(Pawn __instance)
- POSTFIX XeoNovaDan. VisiblePants: Void VisiblePants. Patch_Pawn+Patch_Tick:Postfix(Pawn __instance)
- POSTFIX Roolo. DualWield: Void DualWield.HarmonyInstance. Pawn_Tick:Postfix(Pawn __instance)
- FINALIZER Krkr.RocketMan.Soyuz: Void Soyuz.Patches. Pawn_Tick_Patch:Finalizer(Pawn __instance, Exception __exception)
at Verse.TickList.Tick () [0x0017d] in <f0ac5eb9b52e4cc396c70fc9a4ee15e5>:0
- TRANSPILER net.pardeike.rimworld.lib.harmony: IEnumerable`1 VisualExceptions. ExceptionsAndActivatorHandler:Transpiler(IEnumerable`1 instructions, MethodBase original)
vegapnk commented 1 month ago

@hayashi-tsukigin Thanks for your report! I also want to do an SOS2 run soon, so this is very helpful.

Does this happen once, or does this throw a lot of errors at once?

Is the LifeForceEmpath getting invisible or the other pawn?

hayashi-tsukigin commented 1 month ago

Thanks for your report!

I also want to do an SOS2 run soon, so this is very helpful.

Does this happen once, or does this throw a lot of errors at once?

Is the LifeForceEmpath getting invisible or the other pawn?

There were no errors when the save file was first loaded at first, and pawns could walk normally in space without being invisible.

After a few minutes, the error was thrown once, after which pawns became invisible in the vacuum.

This error will be thrown every once in a while, but it will cause this bug after the first throw

Since most of my pawns are all of one genotype (this is due to the xenogenetic seeds of Warhammer 40K), they have rjw genes and the gene called Empathic LifeForce, so they will all be invisible in the vacuum.

The only pawn I don't have this gene is SOS2's core hologram, which I should test to see if she's invisible later.

hayashi-tsukigin commented 1 month ago

this bug don't happened on SOS2's core hologram,

And if I remove the Empathic Life Force gene by Character Editor, the pawns whose gene is removed can be seen in the vacuum. So it must be the gene that causes the bug.

vegapnk commented 1 month ago

Relevant File

This Could be a missing null-check for pawns that have no agetracker.

This could be another missing null-check if the empath and his lifeforce is null for whatever reason.

The GeneUtility also has no null-checks, maybe the input float is null for whatever reason.

vegapnk commented 2 weeks ago

Should be fixed with v2.2.1