Fixed rare TryFindBestBetterStoreCellFor errors, added better exception handling for drawing errors thrown by other mods
Those log messages now include things and the position where drawing fails Plant printing was slightly improved further too, correctly handling theoretical hydroponics of sizes above 20 now
This commit is contained in:
@@ -36,6 +36,21 @@ public static class StorageExtensions
|
||||
=> slotGroup.parent is Building storage
|
||||
? storage.TrueItemsPerCell() * cellCount
|
||||
: cellCount;
|
||||
|
||||
public static void RecalculateStorageGroupMemberCount(this HaulDestinationManager haulDestinationManager)
|
||||
{
|
||||
haulDestinationManager.map.storageGroups.groups.UnwrapArray(out var storageGroups, out var storageGroupCount);
|
||||
for (var i = storageGroupCount; --i >= 0;)
|
||||
storageGroups.UnsafeLoad(i).SpawnedMemberCount() = 0;
|
||||
|
||||
haulDestinationManager.AllGroupsListInPriorityOrder.UnwrapArray(out var slotGroupsByPriority,
|
||||
out var slotGroupCount);
|
||||
for (var i = slotGroupCount; --i >= 0;)
|
||||
{
|
||||
if (slotGroupsByPriority.UnsafeLoad(i).StorageGroup is { } storageGroup)
|
||||
storageGroup.SpawnedMemberCount()++;
|
||||
}
|
||||
}
|
||||
|
||||
static StorageExtensions()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user