Skip to content

Commit 40c7233

Browse files
committed
Fixes for Initiative when 0
1 parent 14499b9 commit 40c7233

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/cljc/orcpub/common.cljc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
(str (if (pos? val) "+") val))
4545

4646
(defn mod-str [val]
47-
(cond (pos? val) (str " + " val)
48-
(neg? val) (str " - " (int (Math/abs val)))
49-
:else "+"))
47+
(cond (pos? val) (str "+" val)
48+
(neg? val) (str "-" (int (Math/abs val)))
49+
:else (str "+" val)))
5050

5151
(defn map-vals [val-fn m]
5252
(reduce-kv

src/cljs/orcpub/dnd/e5/views.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1832,7 +1832,7 @@
18321832
[:td.p-l-10.p-b-10.p-t-10 (get cls-mods :spell-save-dc)]
18331833
[:td.p-l-10.p-b-10.p-t-10 (common/bonus-str (get cls-mods :spell-attack-modifier))]
18341834
[:td.p-l-10.p-b-10.p-t-10 [:div.tooltip [:button.roll-button
1835-
{:on-click (button-roll-handler (str (:name spell) " attack: ") (str "1d20" (common/bonus-str (get cls-mods :spell-attack-modifier))))}
1835+
{:on-click (button-roll-handler (str (:name spell) " attack: ") (str "1d20" (common/mod-str (get cls-mods :spell-attack-modifier))))}
18361836
"Roll"] [:span.tooltiptext "ctrl+click for advantage shift+click for disadvantage"]]]
18371837
[:td.p-l-10.p-b-10.p-t-10.pointer.orange
18381838
{:on-click on-click}

0 commit comments

Comments
 (0)