Skip to content

Normalize invalid -1 spell limit to 0 in generated monsters - #359

Merged
HarmlessHarm merged 1 commit into
developfrom
feature/generator-hardeing
Sep 11, 2026
Merged

Normalize invalid -1 spell limit to 0 in generated monsters#359
HarmlessHarm merged 1 commit into
developfrom
feature/generator-hardeing

Conversation

@HarmlessHarm

@HarmlessHarm HarmlessHarm commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • The AI monster generator occasionally returns innate_spells entries with limit: -1 (often for cantrip-like spells).
  • The app's display logic treats limit === 0 as "at will" but doesn't handle -1, so these spells rendered with a bogus limit.
  • Added normalization in GenerateMonster.vue, alongside the existing post-generation sanitization, to coerce limit === -1 to 0.

Test plan

  • Generate a monster whose response includes an innate spell with limit: -1 and confirm it renders as "at will" (limit 0) after generation.
  • Confirm caster spells (which have no limit field) are unaffected.

🤖 Generated with Claude Code

The AI generator occasionally returns innate_spells with limit -1,
which isn't handled by the app's "0 = at will" display convention.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

@HarmlessHarm
HarmlessHarm merged commit 8488cb2 into develop Sep 11, 2026
4 checks passed
@HarmlessHarm HarmlessHarm added the bug Something isn't working label Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant