Skip to content

Commit

Permalink
Merge pull request #1053 from Saintis/handsize-flatline-fix
Browse files Browse the repository at this point in the history
Fixes Hand size flatline.
  • Loading branch information
mtgred committed Dec 31, 2015
2 parents 9cd432c + 9701036 commit b87c30e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/clj/game/core-turns.clj
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
(update-all-advancement-costs state side))))

(defn end-turn [state side args]
(let [max-hand-size (get-in @state [side :max-hand-size])]
(let [max-hand-size (max (get-in @state [side :max-hand-size]) 0)]
(when (<= (count (get-in @state [side :hand])) max-hand-size)
(turn-message state side false)
(if (= side :runner)
Expand All @@ -112,4 +112,4 @@
(set-prop state :runner card :added-virus-counter false))))
(swap! state assoc :end-turn true)
(clear-turn-register! state)
(swap! state dissoc :turn-events))))
(swap! state dissoc :turn-events))))
2 changes: 1 addition & 1 deletion src/cljs/netrunner/gameboard.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@

(defn handle-end-turn [cursor owner]
(let [me ((:side @game-state) @game-state)
max-size (:max-hand-size me)]
max-size (max (:max-hand-size me) 0)]
(if (> (count (:hand me)) max-size)
(om/set-state! owner :warning (str "Discard to " max-size " cards"))
(do (om/set-state! owner :warning nil)
Expand Down

0 comments on commit b87c30e

Please sign in to comment.