summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-07-21 19:49:45 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-21 19:49:45 +0200
commita6020e102f5a5a431abd874a7f76707ba20affb1 (patch)
treef4bb4cab7c9469985aa30e62362fac1e23e0939f
parent260c66251ad1bcf1c996d1c9af2e2c7a2dba22e5 (diff)
downloadfield-cloth-gold-a6020e102f5a5a431abd874a7f76707ba20affb1.tar.gz
Fix sorted tiles when observing.
-rw-r--r--play.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/play.js b/play.js
index cfd9fa1..28530db 100644
--- a/play.js
+++ b/play.js
@@ -204,7 +204,8 @@ function on_update() {
let red_court = view.red_court
let blue_court = view.blue_court
if (opt_sort_tiles) {
- hand = hand.slice().sort(cmp_tile)
+ if (hand)
+ hand = hand.slice().sort(cmp_tile)
red_court = red_court.slice().sort(cmp_tile)
blue_court = blue_court.slice().sort(cmp_tile)
}