Added gas grid optimization, various despawn optimizations, new hauling optimizations utilizing events and regions, bugfixes for old patches and for vanilla functions too, as well as smaller additions. 1.3 files removed.

This commit is contained in:
bbradson
2024-01-27 10:24:24 +01:00
parent 0247ad59a1
commit c8b764de68
151 changed files with 7318 additions and 2145 deletions
@@ -9,9 +9,9 @@ using Verse.AI;
namespace PerformanceFish.JobSystem;
public class GenClosestPatches : ClassWithFishPatches
public sealed class GenClosestPatches : ClassWithFishPatches
{
public class ClosestThing_Global_Patch : FishPatch
public sealed class ClosestThing_Global_Patch : FishPatch
{
public override string Description { get; } = "Threading for job scanning. Disabled and unstable.";
public override bool DefaultState => false;
@@ -226,29 +226,4 @@ public class GenClosestPatches : ClassWithFishPatches
}
}
#endif
#if threadingEnabled
public class CanReach_Patch : FishPatch
{
protected CanReach_Patch() => FishSettings.ThreadingPatches.Add(this);
public override bool DefaultState => false;
public override string Description { get; }
= "Lock for threading. Only needed with threading enabled and off by default";
public override Expression<Action> TargetMethod { get; }
= static () => default(Reachability)!.CanReach(default, null, default, default);
public static void Prefix()
{
if (FishSettings.ThreadingEnabled)
Monitor.Enter(Lock);
}
public static Exception Finalizer(Exception __exception)
{
if (FishSettings.ThreadingEnabled)
Monitor.Exit(Lock);
return __exception;
}
private static object Lock { get; } = new();
}
#endif
//}