[PR] Removing refreshables the user doesn't have during rest actions (#1449)

* Marking up the places that need changing for bug #1160

* Creating a shared method called isItemAvailable and using it in downtime

* Explicitely adding the false value rather than relying on undefined returns. Oops

* Removing spaces

* Removing a needless return line

* Adding missing semicolon
This commit is contained in:
Nick Salyzyn 2025-12-20 14:00:16 -07:00 committed by GitHub
parent 605a23ab58
commit 0508bf4188
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 47 additions and 37 deletions

View file

@ -93,7 +93,7 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
}
getRefreshables() {
const actionItems = this.actor.items.reduce((acc, x) => {
const actionItems = this.actor.items.filter(x => this.actor.system.isItemAvailable(x)).reduce((acc, x) => {
if (x.system.actions) {
const recoverable = x.system.actions.reduce((acc, action) => {
if (refreshIsAllowed([this.shortrest ? 'shortRest' : 'longRest'], action.uses.recovery)) {