From b2dc59d0f89a69069ca8fd52caa68a4c68034ada Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 6 Jan 2019 10:34:35 +0000 Subject: Bug fix: make roll20's 'k' notation actually have an effect Signed-off-by: Sean Whitton --- org-d20.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'org-d20.el') 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) -- cgit v1.2.3