Skip to content

Commit 264983f

Browse files
authored
Merge pull request #1035 from ben/no-dsn-fix
Roll cinder/wraith/cursed dice with no DSN
2 parents 2037d33 + 4585efa commit 264983f

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Next Release
44

5+
- Fix a bug where cinder/wraith and cursed-die rolls wouldn't work unless Dice So Nice was enabled ([#1035](https://github.com/ben/foundry-ironsworn/pull/1035))
6+
57
## 1.24.4
68

79
- Fix an issue where new Ironsworn characters would have a blank sheet the first time they were opened ([#1030](https://github.com/ben/foundry-ironsworn/pull/1030))

src/module/features/dice/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ export function cinderAndWraithifyRoll(roll: Roll) {
4242

4343
const cd0options = challengeDice[0].options as any
4444
cd0options.appearance = {
45-
labelColor: (game.dice3d as any).exports?.Utils?.contrastOf(cinderColor),
45+
labelColor: (game.dice3d as any)?.exports?.Utils?.contrastOf(cinderColor),
4646
background: cinderColor,
4747
outline: cinderColor,
4848
edge: cinderColor
4949
}
5050
const cd1options = challengeDice[1].options as any
5151
cd1options.appearance = {
52-
labelColor: (game.dice3d as any).exports?.Utils?.contrastOf(wraithColor),
52+
labelColor: (game.dice3d as any)?.exports?.Utils?.contrastOf(wraithColor),
5353
background: wraithColor,
5454
outline: wraithColor,
5555
edge: wraithColor
@@ -60,7 +60,7 @@ export function cursifyRoll(roll: Roll) {
6060
const die = roll.dice[0]
6161
const cursedColor = '#228822'
6262
;(die.options as any).appearance = {
63-
labelColor: (game.dice3d as any).exports?.Utils?.contrastOf(cursedColor),
63+
labelColor: (game.dice3d as any)?.exports?.Utils?.contrastOf(cursedColor),
6464
background: cursedColor,
6565
outline: cursedColor,
6666
edge: cursedColor

src/module/roll-table/oracle-table.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,10 @@ export class OracleTable extends RollTable {
427427
// Draw from the cursed table
428428
const cursedResult = cursedTable.results.find(
429429
(x) =>
430-
originalRoll.total >= x.range[0] && originalRoll.total <= x.range[1]
430+
(originalRoll.total ?? -1) >= x.range[0] &&
431+
(originalRoll.total ?? -1) <= x.range[1]
431432
)
432-
return { cursedResults: [cursedResult], cursedDie }
433+
return { cursedResults: compact([cursedResult]), cursedDie }
433434
}
434435
}
435436

src/module/vue/sf-truths.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
ref="categoryComponents"
3434
:key="(truth.je()._id as string)"
3535
:je="truth.je"
36-
v-model="categoryModels[truth.je()._id]"
36+
v-model="categoryModels[truth.je()._id ?? '']"
3737
/>
3838
</section>
3939
</div>
@@ -75,7 +75,7 @@ async function saveTruths() {
7575
// Fetch values from the category components
7676
const contentSections: string[] = []
7777
for (const t of props.data.truths) {
78-
const model = categoryModels.value[t.je()._id]
78+
const model = categoryModels.value[t.je()._id ?? '']
7979
if (model.valid)
8080
contentSections.push(
8181
`<h2>${model.title}</h2>

0 commit comments

Comments
 (0)