From 6edce3ed77a01d06abc71982545b432f5b59df5c Mon Sep 17 00:00:00 2001 From: Tim Evans Date: Tue, 2 Jun 2026 19:46:45 +0000 Subject: [PATCH] fix: force zero-engine dice system for all users on load (v1.3.8) --- system.json | 2 +- zero-engine.mjs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/system.json b/system.json index a256760..506e8cd 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "id": "zero-engine", "title": "Zero Engine (SLA Industries)", "description": "A basic game system for SLA Industries using the Zero Engine rules.", - "version": "1.3.7", + "version": "1.3.8", "compatibility": { "minimum": 13, "verified": "14.359" diff --git a/zero-engine.mjs b/zero-engine.mjs index 5f960c0..e57d3c8 100644 --- a/zero-engine.mjs +++ b/zero-engine.mjs @@ -3983,6 +3983,22 @@ Hooks.once("diceSoNiceReady", (dice3d) => { }); }); +// Force zero-engine dice system for any user whose saved DiceSoNice flag +// is pointing at a different system (e.g. Blade Runner defaults from an +// older session on the remote server). The "preferred" flag only kicks in +// for users with NO saved appearance — this hook fixes users who have one. +Hooks.once("ready", async () => { + if (!game.modules.get("dice-so-nice")?.active) return; + const current = game.user.getFlag("dice-so-nice", "appearance") ?? {}; + const savedSystem = current?.global?.system ?? "standard"; + if (savedSystem !== "zero-engine") { + await game.user.setFlag("dice-so-nice", "appearance", { + ...current, + global: { ...(current.global ?? {}), system: "zero-engine" } + }); + } +}); + /** * Handle Push button clicks in chat * Uses new automatic Push mechanics: re-roll all non-6s, Stress + Panic only if stress bane appears