Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/cljs/nr/cardbrowser.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@
art (if (sequential? alt-art) (first alt-art) alt-art)
art-index (if (sequential? alt-art) (second alt-art) 0)
images (image-or-face card)]
(nth (get-image-path images (keyword lang) (keyword res) (keyword art)) art-index))))
(let [art-urls (get-image-path images (keyword lang) (keyword res) (keyword art))
safe-index (min art-index (dec (count art-urls)))]
(nth art-urls safe-index)))))

(defn- base-image-url
"The default card image. Displays an alternate image if the card is specified as one."
Expand Down
3 changes: 2 additions & 1 deletion src/cljs/nr/gameboard/board.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
images (image-or-face card)]
(if (sequential? art)
(let [art-urls (get-image-path images (keyword lang) (keyword res) (keyword (first art)))
chosen-art (nth art-urls (second art))]
safe-index (min (second art) (dec (count art-urls)))
chosen-art (nth art-urls safe-index)]
[chosen-art])
(first (get-image-path images (keyword lang) (keyword res) (keyword art)))))))

Expand Down
Loading