Fix allocated nodes on Cluster Jewels when importing character #7221
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #6718
Description of the problem being solved:
On character import, when Delete Jewels is true, we are keeping the state of cluster jewels in a subgraph. This functionality is used elsewhere in the case where you remove a cluster from the tree and then add it back in. We keep the allocated nodes so that it automatically loads back in when the cluster is returned. The problem is when importing, we're keeping the state of the nodes, including any additionally allocated ones, "in case the cluster comes back" and of course it does because it's part of the import data. So we see the cluster again and allocate all the nodes that were there at time of Import, including ones the Import possibly does not have.
So this PR adds a flag that is set true during Import Delete Jewel true that will ignore saving the state of the cluster jewels for that flow. The flag is reset after deallocating all nodes from the jewels.
Steps taken to verify a working solution:
Link to a build that showcases this PR:
Account name dyfrgi, league All, character ShockingWaffle.
In this case, the Delete Jewels: true is the problem, so character import is required.
Before screenshot:
After screenshot: