Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Hand size flatline. #1053

Merged
merged 1 commit into from
Dec 31, 2015
Merged
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: 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