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
@@ -7,22 +7,21 @@ using PerformanceFish.ModCompatibility;
namespace PerformanceFish.JobSystem;
public class JobGiver_HaulOptimization : ClassWithFishPatches
public sealed class JobGiver_HaulOptimization : ClassWithFishPatches
{
public class PotentialWorkThingsGlobal_Patch : FishPatch
public sealed class PotentialWorkThingsGlobal_Patch : FishPatch
{
public override List<string> IncompatibleModIDs { get; } = [PackageIDs.MULTIPLAYER];
public override string Description { get; }
= "Sorts haulables by distance before running expensive hauling calculations on them to avoid checks on "
+ "far away items";
+ "far away items";
public override MethodBase TargetMethodInfo { get; }
= AccessTools.Method(typeof(JobGiver_Haul), nameof(JobGiver_Haul.TryGiveJob));
public static CodeInstructions? Transpiler(CodeInstructions codes, MethodBase method)
{
if (ActiveMods.Multiplayer) // PUAH has known issues with sorting and multiplayer
return codes;
var pawn_Map_listerHaulables_ThingsPotentiallyNeedingHauling
= FishTranspiler.Call(static () => default(ListerHaulables)!.ThingsPotentiallyNeedingHauling());