RimWorld

RimWorld

Psychology (unofficial) v1.1-1.5
Cedaro Aug 18, 2023 @ 1:13am
Inspector tab disappear
When changing pawn's backstory using Character Editor, the Psyche tab will disappear until reload the save.

This is because Psychology is using an unsafe approach to inject inspector tab dynamically.

The problem is at Psychology.SpeciesHelper:AddInspectorTabToDefAndCorpseDef, codes in this form:

if (t.inspectorTabsResolved == null) { t.inspectorTabsResolved = new List<InspectTabBase>(1); } t.inspectorTabsResolved.AddDistinct(InspectTabManager.GetSharedInstance(typeof(ITab_Pawn_Psyche)));

Directly touching inspectorTabsResolved is unsafe, changes will be overwrited at any time when others resolve it again.

Here's a better approach:

if (t.inspectorTabs == null) { t.inspectorTabs = new List<Type>(1); } t.inspectorTabs.Add(typeof(ITab_Pawn_Psyche)); t.ResolveReferences();
Last edited by Cedaro; Aug 18, 2023 @ 1:15am
< >
Showing 1-1 of 1 comments
che_lovek  [developer] Feb 8, 2024 @ 8:21am 
I've tested this and it does indeed seem to fix a couple of tab telated issues.
Thank you for the suggestion!
< >
Showing 1-1 of 1 comments
Per page: 1530 50