Creating a shared method called isItemAvailable and using it in downtime

This commit is contained in:
nsalyzyn 2025-12-19 10:15:53 -07:00
parent 12d6b7fa4c
commit 459f87f24c
4 changed files with 46 additions and 40 deletions

View file

@ -93,8 +93,7 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
}
getRefreshables() {
const actionItems = this.actor.items.reduce((acc, x) => {
// TODO(nsalyzyn): Eliminate items that the are part of the subclass the actor doesn't have access to.
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)) {