Add a condition so that the "flag" is only checked when there can be "flag", which is when TryFindBestBetterStoreCellForPatch is enabled.
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -442,7 +442,8 @@ public sealed class StoreUtilityPrepatches : ClassWithFishPrepatches
|
|||||||
{
|
{
|
||||||
|
|
||||||
public override string? Description { get; }
|
public override string? Description { get; }
|
||||||
= "Removes haulables from ListerHaulables if the found best store cell turns out to be the current cell";
|
= "Removes haulables from ListerHaulables if the found best store cell turns out to be the current cell. "
|
||||||
|
+ "Need TryFindBestBetterStoreCellFor to work.";
|
||||||
|
|
||||||
public override MethodBase TargetMethodBase { get; } = methodof(StoreUtility.TryFindBestBetterStorageFor);
|
public override MethodBase TargetMethodBase { get; } = methodof(StoreUtility.TryFindBestBetterStorageFor);
|
||||||
|
|
||||||
@@ -473,7 +474,7 @@ public sealed class StoreUtilityPrepatches : ClassWithFishPrepatches
|
|||||||
{
|
{
|
||||||
if (haulDestination == null)
|
if (haulDestination == null)
|
||||||
{
|
{
|
||||||
if (foundCell != IntVec3.Invalid) // TryFindBestBetterStoreCellForPatch says it's already in best cell
|
if (StoreCellForPatchActive && foundCell != IntVec3.Invalid) // TryFindBestBetterStoreCellForPatch says it's already in best cell
|
||||||
{
|
{
|
||||||
foundCell = IntVec3.Invalid;
|
foundCell = IntVec3.Invalid;
|
||||||
TryRemoveFromListerHaulables(t, currentPriority);
|
TryRemoveFromListerHaulables(t, currentPriority);
|
||||||
@@ -500,7 +501,7 @@ public sealed class StoreUtilityPrepatches : ClassWithFishPrepatches
|
|||||||
|
|
||||||
private static int _storeCellForPatchActive = int.MaxValue;
|
private static int _storeCellForPatchActive = int.MaxValue;
|
||||||
|
|
||||||
private static bool StoreCellForPatchActive
|
public static bool StoreCellForPatchActive
|
||||||
=> _storeCellForPatchActive != int.MaxValue
|
=> _storeCellForPatchActive != int.MaxValue
|
||||||
? _storeCellForPatchActive.AsBool()
|
? _storeCellForPatchActive.AsBool()
|
||||||
: UpdateStoreCellForPatchActive();
|
: UpdateStoreCellForPatchActive();
|
||||||
|
|||||||
Reference in New Issue
Block a user