bbradson / Performance-Fish

Performance Mod for RimWorld
Mozilla Public License 2.0
493 stars 36 forks source link

Can't create new stockpile zones #2

Closed Fluxic closed 1 year ago

Fluxic commented 1 year ago

With this mod installed, trying to create new stockpile zones acts like I never released the mouse button except for the tooltip text reappearing. Existing zones can be extended and all other zone tools (that I checked) work fine. Removing performance fish fixes it. It also throws an error every time I try to create a new zone:

Root level exception in OnGUI(): System.InvalidOperationException: Failed to compare two elements in the array. ---> System.NullReferenceException: Object reference not set to an instance of an object
at RimWorld.StatWorker_MarketValue.CalculatedBaseMarketValue (Verse.BuildableDef def, Verse.ThingDef stuffDef) [0x000c4] in <81af9f8a18324e17b286924a43555a7c>:0
at RimWorld.StatWorker_MarketValue.GetValueUnfinalized (RimWorld.StatRequest req, System.Boolean applyPostProcess) [0x000b5] in <81af9f8a18324e17b286924a43555a7c>:0
at (wrapper dynamic-method) RimWorld.StatWorker.RimWorld.StatWorker.GetValue_Patch0(RimWorld.StatWorker,RimWorld.StatRequest,bool)
at RimWorld.StatWorker.GetValueAbstract (Verse.BuildableDef def, Verse.ThingDef stuffDef) [0x00009] in <81af9f8a18324e17b286924a43555a7c>:0
at RimWorld.StatExtension.GetStatValueAbstract (Verse.BuildableDef def, RimWorld.StatDef stat, Verse.ThingDef stuff) [0x00006] in <81af9f8a18324e17b286924a43555a7c>:0
at Verse.ThingDef.get_BaseMarketValue () [0x00000] in <81af9f8a18324e17b286924a43555a7c>:0
at PerformanceFish.ThingFilterPatches+SetAllow_Patch.ComparerMethod (Verse.ThingDef a, Verse.ThingDef b) [0x00007] in <46e138386b6e41969ba7218d869173d6>:0
at System.Collections.Generic.ComparisonComparer`1[T].Compare (T x, T y) [0x00000] in <eae584ce26bc40229c1b1aa476bfa589>:0
at System.Collections.Generic.ArraySortHelper`1[T].InternalBinarySearch (T[] array, System.Int32 index, System.Int32 length, T value, System.Collections.Generic.IComparer`1[T] comparer) [0x00012] in <eae584ce26bc40229c1b1aa476bfa589>:0
at System.Collections.Generic.ArraySortHelper`1[T].BinarySearch (T[] array, System.Int32 index, System.Int32 length, T value, System.Collections.Generic.IComparer`1[T] comparer) [0x0000b] in <eae584ce26bc40229c1b1aa476bfa589>:0
--- End of inner exception stack trace ---
at System.Collections.Generic.ArraySortHelper`1[T].BinarySearch (T[] array, System.Int32 index, System.Int32 length, T value, System.Collections.Generic.IComparer`1[T] comparer) [0x00025] in <eae584ce26bc40229c1b1aa476bfa589>:0
at System.Array.BinarySearch[T] (T[] array, System.Int32 index, System.Int32 length, T value, System.Collections.Generic.IComparer`1[T] comparer) [0x00044] in <eae584ce26bc40229c1b1aa476bfa589>:0
at (wrapper dynamic-method) Verse.ThingFilter.Verse.ThingFilter.SetAllow_Patch1(Verse.ThingFilter,Verse.ThingDef,bool)
at Verse.ThingFilter.SetAllow (Verse.ThingCategoryDef categoryDef, System.Boolean allow, System.Collections.Generic.IEnumerable`1[T] exceptedDefs, System.Collections.Generic.IEnumerable`1[T] exceptedFilters) [0x00032] in <81af9f8a18324e17b286924a43555a7c>:0
at (wrapper dynamic-method) Verse.ThingFilter.Verse.ThingFilter.SetFromPreset_Patch1(Verse.ThingFilter,RimWorld.StorageSettingsPreset)
at RimWorld.StorageSettings.SetFromPreset (RimWorld.StorageSettingsPreset preset) [0x00000] in <81af9f8a18324e17b286924a43555a7c>:0
at RimWorld.Zone_Stockpile..ctor (RimWorld.StorageSettingsPreset preset, Verse.ZoneManager zoneManager) [0x00019] in <81af9f8a18324e17b286924a43555a7c>:0
at RimWorld.Designator_ZoneAddStockpile.MakeNewZone () [0x0000b] in <81af9f8a18324e17b286924a43555a7c>:0
at RimWorld.Designator_ZoneAdd.DesignateMultiCell (System.Collections.Generic.IEnumerable`1[T] cells) [0x00105] in <81af9f8a18324e17b286924a43555a7c>:0
at (wrapper dynamic-method) Verse.DesignatorManager.Verse.DesignatorManager.ProcessInputEvents_Patch3(Verse.DesignatorManager)
at RimWorld.MapInterface.HandleMapClicks () [0x0000f] in <81af9f8a18324e17b286924a43555a7c>:0
at (wrapper dynamic-method) RimWorld.UIRoot_Play.RimWorld.UIRoot_Play.UIRootOnGUI_Patch2(RimWorld.UIRoot_Play)
at (wrapper dynamic-method) Verse.Root.Verse.Root.OnGUI_Patch1(Verse.Root)
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

https://user-images.githubusercontent.com/100442119/201503054-b11ddfec-b9a8-43dd-b585-946a18f8c533.mp4

Log: https://gist.github.com/0eec6f7699c397c36f2e084834a3cc6e Also, I did try removing the Designator Shapes mod but that didn't help.

bbradson commented 1 year ago

You are using RimWorld 1.3 and a couple mods like LT-Gardening Regrown, which require 1.4 and fill the log with early errors. Fish currently can't work in this kinda environment. The error here is specifically caused by another mod's ThingDef having loaded with a CostList that contains null values, which RimWorld's MarketValue StatWorker doesn't allow.

Fluxic commented 1 year ago

Yeah I removed several mods including LT-Gardening Regrown but it doesn't look like they fully removed.

bbradson commented 6 months ago

Error handling for issues in stats from other mods' items, including the market value stat here, has been added now