Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the grants.critical.range flag #67

Merged
merged 9 commits into from
Apr 6, 2024
Prev Previous commit
Next Next commit
don't call getProperty with an undefined targetActor
kaelad02 committed Apr 5, 2024
commit 84db82ac03fa9fcccab0bf25a1a41bbaf5664c49
7 changes: 5 additions & 2 deletions src/reminders.js
Original file line number Diff line number Diff line change
@@ -260,8 +260,11 @@ export class CriticalReminder extends BaseReminder {
this.actionType = item.system.actionType;

// get the Range directly from the actor's flags
const grantsCriticalRange = getProperty(targetActor, "flags.midi-qol.grants.critical.range") || -Infinity;
this._adjustRange(distanceFn, grantsCriticalRange);
if (targetActor) {
const grantsCriticalRange =
getProperty(targetActor, "flags.midi-qol.grants.critical.range") || -Infinity;
this._adjustRange(distanceFn, grantsCriticalRange);
}
}

_adjustRange(distanceFn, grantsCriticalRange) {