Skip to content

Commit

Permalink
filter priorityActors to not include null/undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
roth-michael committed Jun 3, 2024
1 parent f80045f commit 2d5cbea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Rest Recovery Changelog

## Version 1.11.4
- Fixed bug when trying to prompt rest with non-actor tokens on the scene

## Version 1.11.3
- Fixed NPC rests when using Tidy (only from their sheet - still don't support adding them in a prompted rest)
- Due to improvements made to NPC actor data in dnd5e v3.2.0, NPCs should now mostly be able to benefit from the full Rest Recovery workflow; in dnd5e v3.1.x, however, NPC rests will simply use the core rest methods
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "rest-recovery",
"title": "Rest Recovery for 5E",
"description": "Adds 5e long and short rest mechanics and variant rules, such as feats, class features, and hit-dice healing.",
"version": "1.11.3",
"version": "1.11.4",
"authors": [
{
"name": "Wasp",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
let form;
const priorityActors = Array.from(game.scenes.get(game.user.viewedScene)?.tokens?.values()).map(currToken => currToken?.actor) ?? [];
const priorityActors = Array.from(game.scenes.get(game.user.viewedScene)?.tokens?.values()).map(currToken => currToken?.actor).filter(currActor => !!currActor) ?? [];
const otherActors = Array.from(game.actors).filter(dirActor => !priorityActors.map(priActor => priActor.id).includes(dirActor.id));
const validActors = [...priorityActors, ...otherActors].reduce((acc, actor) => {
Expand Down

0 comments on commit 2d5cbea

Please sign in to comment.