Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when editing stats #288

Closed
kmerfeld opened this issue Mar 27, 2024 · 3 comments
Closed

error when editing stats #288

kmerfeld opened this issue Mar 27, 2024 · 3 comments
Assignees
Labels
bug Something isn't working in progress This issue is being worked on

Comments

@kmerfeld
Copy link
Contributor

When on the full character sheet, if I edit an ability (write number, increment, or roll) I get a TypeError: a.split(...)[1] is undefined error in the console and the screen goes white.

I think its not passing the dice correctly to src/support/statSupport.ts getHitDice()

@gvorbeck
Copy link
Owner

Wowwwww,
That's a powerful error. Thank you for bringing it to my attention. I'll try to have a fix for this in the coming days. Good catch.

@gvorbeck gvorbeck self-assigned this Mar 27, 2024
@gvorbeck gvorbeck added bug Something isn't working in progress This issue is being worked on labels Mar 27, 2024
@gvorbeck
Copy link
Owner

Oof, I think I figured out the problem.

In order to make sure a user isn't able to game the system or break the rules when creating a character, I erase a character's stats when making certain changes. (ex: If they changes an ability score, I erase things like Race, Class, Hit Dice, etc because certain choice become unavailable with certain ability scores). This also happens for things like changing a Race selection; I would erase any previously made Class selections in order to make sure they can only have a Class that pertains to that original Race selection.

The solution is going to be checking to see if the user is on the character sheet page. If so, disable all those erasures and allow the user to futz with their completed character no matter what. Then the Hit Dice will not be gone and the page wont crash.

@gvorbeck
Copy link
Owner

gvorbeck commented Mar 27, 2024

This is fixed with codex.quest v2.7.5. I fixed an inadvertent hardcoding of the behavior described above. The ability table now recognizes if it is on the Character Sheet page and does not wipe out other stats when adjusting for the new ability. Thanks again for bringing this to my attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in progress This issue is being worked on
Projects
None yet
Development

No branches or pull requests

2 participants