Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Cn-mjt44 committed Mar 25, 2024
1 parent a3e8992 commit efc45b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 2 additions & 4 deletions RW_NodeTree/CompChildNodeProccesser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -624,10 +624,8 @@ internal void PostFX(RenderTexture tar)
/// <returns></returns>
public bool AllowNode(Thing node, string id = null)
{
if(node?.Destroyed ?? false) return false;
ThingOwner targetOwner = node?.holdingOwner;
Type type = targetOwner?.GetType();
if (type != null && type.Assembly != HarmonyInjector.coreAssembly) return false;
if (node?.holdingOwner != null) return false;
if (node?.Destroyed ?? false) return false;
if (id.NullOrEmpty() || ChildNodes.IsChildOf(node)) return false;
foreach (CompBasicNodeComp comp in AllNodeComp)
{
Expand Down
5 changes: 2 additions & 3 deletions RW_NodeTree/NodeContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public override void ExposeData()
string id = innerIdList[i];
try
{
if (UsedIds.Contains(thing.GetUniqueLoadID()) || (thing.holdingOwner != null && thing.holdingOwner != this)) Scribe_References.Look(ref thing, id);
if (UsedIds.Contains(thing.GetUniqueLoadID())) Scribe_References.Look(ref thing, id);
else Scribe_Deep.Look(ref thing, id);
}
catch(Exception e)
Expand Down Expand Up @@ -269,7 +269,7 @@ internal bool internal_UpdateNode(CompChildNodeProccesser actionNode = null)
state = stateCode.r;
bool reset = true;
if (StopEventBubble) return StopEventBubble;
foreach (Thing node in this.Values)
foreach (Thing node in prveChilds.Values)
{
NodeContainer container = ((CompChildNodeProccesser)node)?.ChildNodes;
if (container != null && container.NeedUpdate)
Expand Down Expand Up @@ -438,7 +438,6 @@ public override bool TryAdd(Thing item, bool canMergeWithExistingStacks = true)

innerList.Add(item);
if (state == stateCode.rw) ((CompChildNodeProccesser)item)?.internal_Added(this, id, true, cachedData);
item.holdingOwner?.Remove(item);
item.holdingOwner = this;
//NeedUpdate = true;
return true;
Expand Down

0 comments on commit efc45b1

Please sign in to comment.