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.
Monsters do not wield artifacts if wielding an ordinary weapon of the same type.
The wielding code compares base weapon types and incorrectly treats a artifacts and an ordinary item of the same type as the same.
For weapons of the same base type, switch only from an ordinary weapon to an artifact; retain an already-wielded artifact. Sunsword and Vorpal Blade cannot replace each other through this same-type rule. Selecting the object already wielded consumes no turn. Ordinary weapons of the same type never cause a switch, regardless of enchantment or inventory order. Different-type selection and the existing cursed-weapon restriction remain unchanged. The change is recorded in
doc/fixes5-0-1.txt.Validation: tested the revised code in terminal and Qt builds using disposable wizard games and the real selection and wielding routines. In each build, eight combinations of inventory order, starting weapon, and equal or different enchantments passed 100 repeated ordinary-weapon checks each with no switches. A +0 longsword switched to +7 Sunsword, with worn flags and artifact light verified; 100 subsequent checks consumed no turns and did not cycle. An additional 100 repeated checks in each direction confirmed that Sunsword never switched to Vorpal Blade and Vorpal Blade never switched to Sunsword. The test used a monster eligible to touch both artifacts and verified that selection chose the other artifact, so alignment restrictions could not mask a failure. A cursed current weapon blocked the artifact switch, and a different-type ordinary weapon upgrade still succeeded. Qt tests used its terminal interface, not its graphical UI.
git diff --checkpasses. This revision is not installed in the live game.