Conversation
Account for pet hunger while away from a level
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.
Blind characters can inspect cockatrice corpses at pickup and looting prompts without risking petrification.
This addresses an existing BUG comment in the source. The change is recorded in doc/fixes5-0-1.txt.
Using
:at the traditional pickup or container-looting category prompt lists cockatrice corpses while blind without checking whether feeling them causes petrification. The ordinary look-here path performs that check, butsimple_look()only prints object names.Apply the existing
will_feel_cockatrice()andfeel_cockatrice()rules when inspecting objects outside inventory. Stop at the dangerous corpse, close the menu before processing petrification, and stop the enclosing selection even if life-saving or polymorph allows the hero to survive. Do not mark the entire container as inspected after an interrupted look. Gloves, stone resistance, sighted inspection, and inventory inspection retain their existing behavior.Validation: source-extracted C tests compiled with AddressSanitizer and UndefinedBehaviorSanitizer reproduce eight failing expectations in the baseline; the patched version passes all 19 checks. Cases cover floor and container chains, a single corpse, returning from the touch handler, menu cleanup, hidden later objects, and the four safe cases above. The complete modified pickup.c translation unit passes clang syntax checking, and the exported patch applies to the installed build's source.
Full-game integration on macOS x86-64 now passes all 12 corpse-inspection scenarios: floor and container inspection, each tested unprotected, wearing gloves, with stone resistance, sighted, wearing an amulet of life-saving, and in flesh-golem form. Unprotected touch caused petrification; life-saving consumed the amulet; flesh golems transformed into stone golems. Inspection stopped after survival and the container remained unknown. These tests ran in fresh disposable games with wizard-only fixture hooks and the real pickup/looting UI and petrification code; no petrification handler was stubbed.