Skip to content

Do not abort when suspending a craft identical to a suspended one - #696

Open
anankex wants to merge 1 commit into
Attnam:masterfrom
anankex:fix-craft-suspend-abort
Open

anankex wants to merge 1 commit into
Attnam:masterfrom
anankex:fix-craft-suspend-abort

Conversation

@anankex

@anankex anankex commented Nov 6, 2026 •

Copy link
Copy Markdown

Suspending a craft can abort the game with "this crafting was already suspended".

craftcore::AddSuspended() rejects a recipedata whose id() 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 recipedata matches the current state of the world.

Steps to reproduce:

  1. Split a lump with "split raw materials".
  2. When hunger interrupts the craft ("You are getting really hungry. Continue crafting?"), answer no. The craft gets suspended.
  3. Start the same split again instead of resuming it, and answer no at the next hunger prompt.

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.cpp is the same on master. Before the patch, step 3 aborts in AddSuspended(). 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant