aboutsummaryrefslogtreecommitdiff
path: root/org-d20.el
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-01-06 10:34:35 +0000
committerSean Whitton <spwhitton@spwhitton.name>2019-01-06 10:34:35 +0000
commitb2dc59d0f89a69069ca8fd52caa68a4c68034ada (patch)
treebf2c7fcf08980a26ee1a4e6e0cd72719e2e86096 /org-d20.el
parent373361744e144bcee5327a07f4c1c3792299d775 (diff)
downloadorg-d20-b2dc59d0f89a69069ca8fd52caa68a4c68034ada.tar.gz
Bug fix: make roll20's 'k' notation actually have an effect
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'org-d20.el')
-rw-r--r--org-d20.el7
1 files changed, 3 insertions, 4 deletions
diff --git a/org-d20.el b/org-d20.el
index b8b79d9..863b8c9 100644
--- a/org-d20.el
+++ b/org-d20.el
@@ -129,10 +129,9 @@ the best N of them, e.g., 4d6k3."
(let ((rolls*
(org-d20--rolls-concat sign rolls (int-to-string times))))
(cons rolls* (+ total (* sign times))))
- (while (> times 0)
- (let ((new-roll (1+ (random sides))))
- (push new-roll new-rolls))
- (setq times (1- times)))
+ (loop repeat times
+ do (let ((new-roll (1+ (random sides))))
+ (push new-roll new-rolls)))
(when keep
;; TODO: This should drop the items without reordering the
;; list (spw 2019-01-05)