From 9bff4d68fd8d1ed283c929e1e6b6d93b8929e133 Mon Sep 17 00:00:00 2001 From: cadowtin Date: Wed, 19 Jun 2024 14:00:12 -0500 Subject: [PATCH] Fix for replacing value --- scripts/addons/socket.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/addons/socket.js b/scripts/addons/socket.js index aa09756..8968998 100644 --- a/scripts/addons/socket.js +++ b/scripts/addons/socket.js @@ -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) {