From fccd8e6d15522e430ca3a7d1e9493d4000f18260 Mon Sep 17 00:00:00 2001 From: siimav Date: Sun, 29 Sep 2024 03:12:00 +0300 Subject: [PATCH] Fix tank UsedBy update not running. Worked fine when loading a craft file but not when building something from scratch. --- Source/Tanks/EditorPartSetMaintainer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Tanks/EditorPartSetMaintainer.cs b/Source/Tanks/EditorPartSetMaintainer.cs index fe802ee5..4cc4b53c 100644 --- a/Source/Tanks/EditorPartSetMaintainer.cs +++ b/Source/Tanks/EditorPartSetMaintainer.cs @@ -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 hostTarget) { // Attaching: host is the incoming part - if (hostTarget.target?.packed == true) + if (hostTarget.target?.ship == EditorLogic.fetch.ship) ScheduleUpdateIfNeeded(hostTarget, isAttachEvent: true); }