diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2019-01-06 10:34:35 +0000 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2019-01-06 10:34:35 +0000 |
commit | b2dc59d0f89a69069ca8fd52caa68a4c68034ada (patch) | |
tree | bf2c7fcf08980a26ee1a4e6e0cd72719e2e86096 | |
parent | 373361744e144bcee5327a07f4c1c3792299d775 (diff) | |
download | org-d20-b2dc59d0f89a69069ca8fd52caa68a4c68034ada.tar.gz |
Bug fix: make roll20's 'k' notation actually have an effect
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | NEWS.md | 1 | ||||
-rw-r--r-- | org-d20.el | 7 |
2 files changed, 4 insertions, 4 deletions
@@ -4,6 +4,7 @@ - Bug fix: off-by-one error in call to `random` - This meant that the maximum value on a dice could never be rolled. Now monsters can critically hit players again. +- Bug fix: make roll20's 'k' notation actually have an effect - Change default keybindings to match Emacs conventions - Avoid binding to <f9> @@ -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) |