Repository navigation
Conversation
recipedata::id() is built from the recipe, tools, spawn settings and locations, so two crafts of the same recipe with the same tool at the same place share it. Suspending the second one hit the duplicate check in craftcore::AddSuspended() and aborted the game. Replace the stale entry with the new one instead. The newer recipedata matches the current state of the world.
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.
Suspending a craft can abort the game with "this crafting was already suspended".
craftcore::AddSuspended()rejects arecipedatawhoseid()matches a suspended one.id()is built from the recipe, tools, spawn settings and locations, so two crafts of the same recipe with the same tool at the same place share it. The game aborts when the player suspends one craft and then suspends an identical new one instead of resuming the first.The fix replaces the stale entry with the new one. The newer
recipedatamatches the current state of the world.Steps to reproduce:
I tested on a Linux build of the v060 source with AddressSanitizer, with a breakpoint that keeps nutrition just above the hunger threshold so the hunger prompt appears on every craft turn.
cmdcraft.cppis the same on master. Before the patch, step 3 aborts inAddSuspended(). After the patch, both crafts get suspended and the game keeps running.The abort message overflows the buffer in
globalerrorhandler::Abort(). #697 fixes that separately.