From 092e16e042e10de44e682f01fe3efe4c24bd3f91 Mon Sep 17 00:00:00 2001 From: Thomas Hintz Date: Fri, 7 Feb 2020 10:52:40 -0800 Subject: [PATCH] Fixing UI actions bug where "You gained $0 was repeatedly shown." --- src/server/farm.scm | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/server/farm.scm b/src/server/farm.scm index 7078526..1d371ba 100644 --- a/src/server/farm.scm +++ b/src/server/farm.scm @@ -726,14 +726,17 @@ (do-action action player) (set! (game-actions game) (cdr (game-actions game))) - (set-ui-action! `((action . "money") - (value . ,(- (player-cash player) - previous-cash))) - game) - (create-ws-response player "action" - `((action . "money") - (value . ,(- (player-cash player) - previous-cash)))))) + (if (= (- (player-cash player) previous-cash) 0) + (loop) + (begin + (set-ui-action! `((action . "money") + (value . ,(- (player-cash player) + previous-cash))) + game) + (create-ws-response player "action" + `((action . "money") + (value . ,(- (player-cash player) + previous-cash)))))))) ((or (eq? name 'harvest-mult) (eq? name 'player-action-post-harvest)) (set! (game-actions game) (cdr (game-actions game))) @@ -1690,9 +1693,4 @@ ;; make sure two players can't have the same name ;; bug: harvest action multiplayer doesn't flow right for other players ;; info actions should look better -;; bug: notify when need to raise money because less than 0 -;; bug: loans is buggy when negative cash ;; bug: dice shows no value when landing on christmas vacation -;; hide Join Game when no games to join -;; livestock bonus card (or anytime holding a card?) causes "you -;; gained $0" to show every turn