Skip to content

Commit

Permalink
Fix tank UsedBy update not running.
Browse files Browse the repository at this point in the history
Worked fine when loading a craft file but not when building something from scratch.
  • Loading branch information
siimav committed Sep 29, 2024
1 parent 4651492 commit fccd8e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Tanks/EditorPartSetMaintainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ private void UpdateCrossfeedSets(ShipConstruct ship)
}

// Only trigger updates if a part in the tree that was added/removed is a fuel consumer
// Note that part packed status will be false when a ShipContruct is being loaded.
// Note that target ship and EditorLogic ship will be different when a ShipContruct is being loaded.
// We don't want to run the checks and scheduling in this case.
// Also note that we do not run updates on ghosted parts.
private void OnPartAttach(GameEvents.HostTargetAction<Part, Part> hostTarget)
{
// Attaching: host is the incoming part
if (hostTarget.target?.packed == true)
if (hostTarget.target?.ship == EditorLogic.fetch.ship)
ScheduleUpdateIfNeeded(hostTarget, isAttachEvent: true);
}

Expand Down

0 comments on commit fccd8e6

Please sign in to comment.