Fix muddy skull being unobtainable after dying with it - #1183
Merged
GregHib merged 1 commit intoAug 18, 2026
Conversation
The rocks at the mining spot tracked whether the skull had been taken
with the `rocks_restless_ghost` player var, and only reset it from a
`playerDeath` handler that checked `ownsItem("muddy_skull")`.
`Death.killed` runs synchronously before `dropItems`, so the skull was
still in the inventory when that handler ran and the var was never
reset. The skull then dropped to the gravestone and, once that expired,
searching the rocks only replied "You already have the ghost's skull."
- leaving the quest stuck at `found_skull` because the coffin requires
the skull to be carried.
Make ownership authoritative at search time instead: searching the
emptied rocks now hands the skull back whenever the player no longer
owns one, which covers death, manually dropping it and an expired
gravestone alike. The ineffective death handler is removed; the
`destroyed` handler stays so the rocks visually refill straight away.
GregHib
approved these changes
Aug 18, 2026
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.
Bug
Dying while carrying the muddy skull during The Restless Ghost permanently blocks the quest.
The rocks at the mining spot track whether the skull has been taken with the
rocks_restless_ghostplayer var, and it was only reset from aplayerDeathhandler:playerDeath { if (!ownsItem("muddy_skull")) { set("rocks_restless_ghost", "skull") } }Death.killed(player)runs synchronously inPlayerDeathbeforedropItems, so the skull is still in the inventory when the handler runs,ownsItemreturns true and the var is never reset. The skull then drops to the gravestone, and once that expires searching the rocks only replies "You already have the ghost's skull." The quest dead-ends atfound_skullbecause the coffin requires the skull to be carried.Fix
Make ownership authoritative at search time rather than depending on death-hook ordering:
Player.takeSkull().ownsItem("muddy_skull")(inventory, equipment, bank, beast of burden) and hands the skull back when the player no longer owns one.playerDeathhandler. Thedestroyedhandler stays so the rocks visually refill immediately when the skull is destroyed.This covers every loss path - death, manually dropping it, and an expired gravestone - not just death.
Tests
Two tests added to
RestlessGhostQuest:Search the rocks again after losing the skull on death- take the skull, die in the wilderness so it is dropped rather than kept, then re-search the rocks and get it back.Rocks stay empty while still carrying the skull- no duplicate skull while one is held.The first test fails without the fix. All three tests in the class pass with it.