Skip to content

Commit

Permalink
update condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Cn-mjt44 committed Apr 26, 2024
1 parent 021dc6b commit cfa6be1
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 2 deletions.
Binary file modified 1.3/Assemblies/RW_NodeTree.dll
Binary file not shown.
Binary file modified 1.4/Assemblies/RW_NodeTree.dll
Binary file not shown.
Binary file modified 1.5/Assemblies/RW_NodeTree.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions src/RW_NodeTree/NodeContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public override int TryAdd(Thing item, int count, bool canMergeWithExistingStack
return 0;
}

if (state != stateCode.fw && !CanAcceptAnyOf(item, canMergeWithExistingStacks))
if ((state != stateCode.fw && !CanAcceptAnyOf(item, canMergeWithExistingStacks)) || item.holdingOwner != null || IsChildOf(item))
{
return 0;
}
Expand Down Expand Up @@ -426,7 +426,7 @@ public override bool TryAdd(Thing item, bool canMergeWithExistingStacks = true)
goto fail;
}

if (state != stateCode.fw && !CanAcceptAnyOf(item, canMergeWithExistingStacks)) goto fail;
if ((state != stateCode.fw && !CanAcceptAnyOf(item, canMergeWithExistingStacks)) || item.holdingOwner != null || IsChildOf(item)) goto fail;

if (Count >= maxStacks) goto fail;

Expand Down

0 comments on commit cfa6be1

Please sign in to comment.