chiark / gitweb /
clock: Allow clearing another player from a place at the clock
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 3 Apr 2021 17:44:06 +0000 (18:44 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 4 Apr 2021 19:07:53 +0000 (20:07 +0100)
I don't think this really calls for Wresting.  It's not like you'd do
it by mistake.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/clock.rs

index 46d405ecdbd8b395bfd4d4b85030d706cb6c6612..1102c13aa703050ee241f0c34453a74c9f04de7f 100644 (file)
@@ -659,11 +659,8 @@ impl PieceTrait for Clock {
       },
       "unclaim-x" | "unclaim-y" => {
         let user = get_user();
-        if state.users[user].player != player {
-          throw!(OE::BadPieceStateForOperation);
-        }
         state.users[user].player = default();
-        (Unpredictable, format!("released player {} at the", user))
+        (Unpredictable, format!("cleared player {} at the", user))
       },
       _ => {
         throw!(OE::BadPieceStateForOperation);