Fix parallel queues not pausing production for more than one of same item queued#21480
Merged
Conversation
| protected override void PauseProduction(string itemName, bool paused) | ||
| { | ||
| foreach (var item in Queue.FindAll(a => a.Item == itemName)) | ||
| item?.Pause(paused); |
Member
There was a problem hiding this comment.
Looks like the following would suffice? (for both overrides)
foreach (var item in Queue.Where(a => a.Item == itemName))
item.Pause(paused);
RoosterDragon
approved these changes
Jul 8, 2024
PunkPun
reviewed
Jul 8, 2024
PunkPun
left a comment
Member
There was a problem hiding this comment.
Could you provide a reproduction case? And also if this is a regression it would be nice to see which PR regressed it
Contributor
Author
Change any of the classicproductionqueues in RA's player.yaml to a classicparallelproductionqueue, queue up more than one of an item, and try to pause production. Previously it only displayed paused on the widget but cash was still drained (as it moved on to producing the next one queued) |
Member
|
Can confirm those reproduction steps replicate the issue, and that this PR fixes it. |
abcdefg30
approved these changes
Sep 19, 2024
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Parallel production queues did not pause production if more than one of the paused item was queued, because not all instances queued were paused and it simply moved on to producing the next one that was in the queue. This PR fixes it by pausing all instances of the paused item in the queue