Skip to content

Commit

Permalink
Fix for replacing value
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed Jun 19, 2024
1 parent 8e70dfd commit 9bff4d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/addons/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ async function createEffects(data) {
core: { sourceId: data.eff },
});
if (data.setChoice && data.setChoice?.flag && data.setChoice?.value) {
const idx = source.system.rules.indexOf(rule => rule.flag === data.setChoice.flag);
const idx = source.system.rules.findIndex(
(rule) => rule.flag === data.setChoice.flag
);
source.system.rules[idx].selection = data.setChoice.value;
}
if (data.level) {
Expand Down

0 comments on commit 9bff4d6

Please sign in to comment.