Fix compatibility with Rimfactory's digital storage

760/768 being the limit and errors getting thrown when randomly overhauling are issues PRF independently has, with nothing else present too
This commit is contained in:
bbradson
2024-01-27 12:48:22 +01:00
parent c8b764de68
commit 20aebe4e83
8 changed files with 78 additions and 10 deletions
@@ -149,9 +149,11 @@ public sealed class StorageSettingsPatches : ClassWithFishPatches
private CompProperties? _lwmProps;
private DefModExtension? _rimfactoryExtension;
public event Action<StorageSettings>? SettingsChanged;
public int TotalSlots => _parent!.TrueItemsPerCell(_lwmProps) * _parent!.SlotGroupCellCount();
public int TotalSlots => _parent!.TrueTotalSlots(_lwmProps, _rimfactoryExtension);
public List<Thing> StoredThingsOfDef(ThingDef def) => _storedThingsByDef.GetOrAdd(def.shortHash);
@@ -167,6 +169,7 @@ public sealed class StorageSettingsPatches : ClassWithFishPatches
_storedThingsByDef.Clear();
AllowedToAccept.Clear();
_lwmProps = slotGroupParent.TryGetLwmCompProperties();
_rimfactoryExtension = slotGroupParent.TryGetRimfactoryExtension();
FreeSlots = TotalSlots;
}