From 4ea8190adca3c1bfc080e8270b912a578ec2b3e9 Mon Sep 17 00:00:00 2001 From: Vlyan Date: Mon, 11 Oct 2021 18:13:25 +0200 Subject: [PATCH] Fixed a bug introduced by DiceSoNice 4.2.1 --- CHANGELOG.md | 3 +++ system/scripts/hooks.js | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7a453e..670b6c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ - Compendiums : - PoW: 'Urbane and Worldly' advantage was misspelled 'Wroldly' (thx to Cernunnos). +## 1.3.5 - DsN hotfix +- Fixed a bug introduced by DiceSoNice 4.2.1 : context in "diceSoNiceRollStart" hook rebuild data and lost what we needed. The consequence is 3d dice flood a lot in RnK. + ## 1.3.4 - Compendiums Update - Fixed a bug with sheet item drop introduced in previous version. - Added FoV English Opportunities usage. diff --git a/system/scripts/hooks.js b/system/scripts/hooks.js index 616e8ae..c8e1d6d 100644 --- a/system/scripts/hooks.js +++ b/system/scripts/hooks.js @@ -259,7 +259,10 @@ export default class HooksL5r5e { * @param {object} context */ static diceSoNiceRollStart(messageId, context) { - if (context.roll.l5r5e?.history) { + // In DsN 4.2.1+ the roll is altered in context. + // So we need to get the original message instead of "context.roll.l5r5e?.history" + const message = game.messages.get(messageId); + if (message?._roll?.l5r5e?.history) { context.blind = true; } }