Repository navigation
Stop sheet commands when a guard fails inside braces, and clear empty values - #20
Merged
Merged
Conversation
… values An @Assert in a routine @included inside @if braces ends only those braces, so a missing player (and, for +sheet/coin <name>=<n> in FitD, a non-keeper) carried on with an empty or unchecked target. Each such @if in the d20, Fate, PbtA, FitD, BRP and Ironsworn sheets is now followed by the same check at the top level. attrib_set() with an empty value stores an empty attribute, which default() reads as empty rather than the default: Ironsworn momentum after a reset, FitD stress and coin at 0, BRP hit points at full. Those writes now clear the attribute. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rqqt7SvmwqfPpiD52tHtJw
|
Warning Review limit reached
This review includes 8 billable files and costs up to $2.00.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 53 minutes for your next included review. View limit details
|
HarryCordewener
marked this pull request as ready for review
November 1, 2026 03:18
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.
Requested by Grave · project thread
Two bugs in the sheets from #16, #17 and #18, found while testing another sheet.
@ifbraces didn't stop the command.@assertin an@included routine ends only the braces it runs in. So+sheet Nobodyfrom a keeper drew a sheet of#-1errors,+sheet/set Nobody/iron=3went on to "There is no stat ''", and in FitD+sheet/coin Bob=5from a non-keeper got pastINCNEEDKEEPER. Each such@if(19 in d20, Fate, PbtA, FitD, BRP, Ironsworn) is now followed by the same check at the top level.attrib_set(x, if(...))stored an empty attribute where it meant to clear, anddefault()reads that as empty. Ironsworn momentum showed blank afterreset, FitD stress/coin at 0, BRP HP at full. These writes now clear withattrib_set(x).Each changed sheet goes to 1.0.1.
Testing
On a local server, before the fix:
+sheet Nobodyas a keeper drew the#-1sheet, and+sheet/momentum resetleftIRONSWORNMETERMOMENTUMpresent and empty. After it:+sheet Nobody,/set Nobody/..., meters,+vow/mark Nobody/x,+vow Nobody,/harm,/hp,/coinall stop at "There is no player called 'Nobody'." in all six sheets.+sheet/coin Bob=5→ "Only sheet keepers do that.";+sheet/stress Bob=1→ "Only sheet keepers change another character's sheet."hasattr0).tools/PackageValidator --strict: PASSED.Generated by Claude Code