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
@@ -11,7 +11,25 @@ public abstract class FishClassPrepatch : FishPrepatchBase
{
public abstract Type Type { get; }
public virtual void FreePatch(TypeDefinition typeDefinition)
public abstract void FreePatch(TypeDefinition typeDefinition);
protected internal override void ApplyPatch(ModuleDefinition module)
{
// ReSharper disable once NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract
var patchType = Type
?? ThrowHelper.ThrowInvalidOperationException<Type>(
$"Patch {GetType().FullName} has no target type.");
if (patchType.IsGenericType)
patchType = patchType.GetGenericTypeDefinition();
DebugLog.Message($"Applying prepatch {GetType().FullName} on type {
patchType.FullName}");
var targetType = module.GetType(patchType.Namespace, patchType.Name) ?? ThrowForFailureToFindType(patchType);
// PrepatchManager.AddSecurityAttributes(targetType.SecurityDeclarations, module);
FreePatch(targetType);
}
}