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:
bbradson
2024-03-10 20:05:24 +01:00
parent a4ee95fde1
commit be3dae46bb
45 changed files with 1090 additions and 414 deletions
+42
View File
@@ -0,0 +1,42 @@
// Copyright (c) 2023 bradson
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
using JetBrains.Annotations;
namespace PerformanceFish;
[UsedImplicitly(ImplicitUseTargetFlags.WithMembers)]
public record struct DefPair
{
private uint _data;
public ushort First
{
get => (ushort)(_data >> 16);
set => _data = (_data & 0x00_00_FF_FF) | ((uint)value << 16);
}
public ushort Second
{
get => (ushort)_data;
set => _data = (_data & 0xFF_FF_00_00) | value;
}
public DefPair(Def first, Def second) : this(first.shortHash, second.shortHash)
{
}
public DefPair(ushort first, ushort second) => _data = Create(first, second);
public bool Equals(DefPair other) => _data == other._data;
public override int GetHashCode() => unchecked((int)_data);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint Create(Def first, Def second) => Create(first.shortHash, second.shortHash);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static uint Create(ushort first, ushort second) => ((uint)first << 16) | second;
}