Skip to content

Commit

Permalink
fix: 🐛 Skills not rendering correctly homebrew
Browse files Browse the repository at this point in the history
  • Loading branch information
aMediocreDad committed Jul 30, 2024
1 parent 25add0e commit 47f52eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/shaggy-keys-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"forbidden-lands": patch
---

Fix skills not rendering correctly on character sheet when attributes have been swapped
8 changes: 4 additions & 4 deletions src/actor/actor-sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,10 +529,10 @@ export class ForbiddenLandsActorSheet extends ActorSheet {
}

computeSkills(data) {
for (const skill of Object.values(data.system.skill)) {
skill[`has${skill?.attribute?.capitalize()}`] = false;
if (CONFIG.fbl.attributes.includes(skill.attribute))
skill[`has${skill.attribute.capitalize()}`] = true;
const map = CONFIG.fbl.skillAttributeMap;
for (const [key, skill] of Object.entries(data.system.skill)) {
const connectedAttribute = map[key];
skill[`has${connectedAttribute.capitalize()}`] = true;
}
return data;
}
Expand Down

0 comments on commit 47f52eb

Please sign in to comment.