fix: force zero-engine dice system for all users on load (v1.3.8)

This commit is contained in:
2026-06-02 19:46:45 +00:00
parent bf927ed382
commit 6edce3ed77
2 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
"id": "zero-engine", "id": "zero-engine",
"title": "Zero Engine (SLA Industries)", "title": "Zero Engine (SLA Industries)",
"description": "A basic game system for SLA Industries using the Zero Engine rules.", "description": "A basic game system for SLA Industries using the Zero Engine rules.",
"version": "1.3.7", "version": "1.3.8",
"compatibility": { "compatibility": {
"minimum": 13, "minimum": 13,
"verified": "14.359" "verified": "14.359"
+16
View File
@@ -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 * Handle Push button clicks in chat
* Uses new automatic Push mechanics: re-roll all non-6s, Stress + Panic only if stress bane appears * Uses new automatic Push mechanics: re-roll all non-6s, Stress + Panic only if stress bane appears