Skip to content

Commit

Permalink
Fixed so that ToBestiary button in actor sheet adds the baseactor pro…
Browse files Browse the repository at this point in the history
…perly
  • Loading branch information
WBHarry committed Sep 20, 2024
1 parent 3fda816 commit 2405ab1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions BestiaryTracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -6561,7 +6561,9 @@ class NPC extends Creature {
}

get initialType() {
const filteredCategories = game.user.isGM ? this.npcData.categories : this.npcData.categories.filter(x => !x.hidden);
const filteredCategories = game.user.isGM
? this.npcData.categories
: this.npcData.categories.filter((x) => !x.hidden);
return filteredCategories.length > 0
? filteredCategories.value
: "unaffiliated";
Expand Down Expand Up @@ -16351,7 +16353,7 @@ Hooks.on("getActorSheetHeaderButtons", (options, buttons) => {
icon: "fas fa-check",
default: true,
callback: () => {
PF2EBestiary.addMonster(options.object, true);
PF2EBestiary.addMonster(options.object.token.baseActor, true);
},
},
{
Expand Down
5 changes: 4 additions & 1 deletion pf2e-bestiary-tracking.js
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,10 @@ Hooks.on("getActorSheetHeaderButtons", (options, buttons) => {
icon: "fas fa-check",
default: true,
callback: () => {
PF2EBestiary.addMonster(options.object, true);
PF2EBestiary.addMonster(
options.object.token.baseActor,
true,
);
},
},
{
Expand Down

0 comments on commit 2405ab1

Please sign in to comment.