mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-22 07:23:37 +02:00
Made baseEffect.stacking nullable instead of having an enabled property
This commit is contained in:
parent
0fbe027d7d
commit
5ff1d0c71f
14 changed files with 70 additions and 43 deletions
|
|
@ -89,12 +89,12 @@ export default class DhEffectsDisplay extends HandlebarsApplicationMixin(Applica
|
|||
const element = event.target.closest('.effect-container');
|
||||
const effects = DhEffectsDisplay.getTokenEffects();
|
||||
const effect = effects.find(x => x.id === element.dataset.effectId);
|
||||
if (!effect || (delta >= 0 && !effect.system.stacking?.enabled)) {
|
||||
if (!effect || (delta >= 0 && !effect.system.stacking)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const maxValue = effect.system.stacking.max ?? Infinity;
|
||||
const newValue = Math.clamp((effect.system.stacking.value ?? 1) + delta, 0, maxValue);
|
||||
const maxValue = effect.system.stacking?.max ?? Infinity;
|
||||
const newValue = Math.clamp((effect.system.stacking?.value ?? 1) + delta, 0, maxValue);
|
||||
if (newValue > 0) {
|
||||
await effect.update({ 'system.stacking.value': newValue });
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue