chiark / gitweb /
message about other piece
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Jul 2020 20:47:29 +0000 (21:47 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Jul 2020 20:47:29 +0000 (21:47 +0100)
templates/script.ts

index 0be586ad29a1708fabaa1ef9d5c35ed619c35497..48b23578742e734cf147201e7a0e298cb29322cf 100644 (file)
@@ -190,7 +190,10 @@ function drag_mousedown(e : MouseEvent) {
   let p = pieces[piece]!;
   drag_piece = piece;
   var held = p.held;
-  if (held != null && held != us) { return; }
+  if (held != null && held != us) {
+    add_log_message('That piece is held by another player.');
+    return;
+  }
 
   dcx = e.clientX;
   dcy = e.clientY;