Added stat caching, fixed all the bugs
Added RitualObligationTriggers analyzer category, Fixed defs from other mods with broken market value breaking fish's storage patches, Fixed storage caches not updating for quality, rotting and similar changes to stored things, Fixed storage caches not updating capacity when reinstalling storage, Fixed prison labor compatibility, Improved multiplayer compatibility, Fixed ideology style dominance and altar sharing patches throwing errors instead of defaulting to disabled when not having ideology, Fixed compatibility with RIMMSqol's world pawn GC patch by disabling that patch, Fixed rare threading issues throwing errors on startup
This commit is contained in:
@@ -112,6 +112,16 @@ public static class PrepatcherFields
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static extern ref HaulDestinationManagerCache Cache(this HaulDestinationManager manager);
|
||||
|
||||
[PrepatcherField]
|
||||
[ValueInitializer(nameof(CreateBaseStatsCache))]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static extern float[] BaseStatsCache(this ThingDef thingDef);
|
||||
|
||||
[PrepatcherField]
|
||||
[ValueInitializer(nameof(GetEmptyArray))]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static extern ref float[] StatsCache(this BuildableDef buildableDef);
|
||||
|
||||
[PrepatcherField]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static extern ref object MonitorObject(this GasGrid gasGrid);
|
||||
@@ -155,6 +165,14 @@ public static class PrepatcherFields
|
||||
public static Listers.Buildings.Cache CreateListerBuildingsCache() => new();
|
||||
public static Listers.Haulables.Cache CreateListerHaulablesCache() => new();
|
||||
public static HaulDestinationManagerCache CreateHaulDestinationManagerCache() => new();
|
||||
public static float[] GetEmptyArray() => Array.Empty<float>();
|
||||
|
||||
public static float[] CreateBaseStatsCache()
|
||||
{
|
||||
var array = new float[Enum.GetNames(typeof(Defs.ThingDefPatches.Stats)).Length];
|
||||
StatCaching.ResetToDefaults(array);
|
||||
return array;
|
||||
}
|
||||
|
||||
public static object CreateGroupMonitorObject()
|
||||
=> ParallelNoAlloc.RegisterBackgroundWaitingWorkers(Array.Empty<Action>());
|
||||
|
||||
Reference in New Issue
Block a user