chiark / gitweb /
always make tokens
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 5 Dec 2020 15:35:40 +0000 (15:35 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 5 Dec 2020 15:35:40 +0000 (15:35 +0000)
If we are asked to "redeliver" a token but there isn't one, make one
up.  So now conceptually you have tokens for all your games even if
you don't know what they are yet.

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

index cbd431bc9d99b19554f73560f5ab90a5bffb78cf..96b78ddaa9a580d64a8ebc9b74ca0dca7a060851 100644 (file)
@@ -711,6 +711,8 @@ impl<'ig> InstanceGuard<'ig> {
         .collect()
     };
 
+    let reset = reset || current_tokens.is_empty();
+
     let token : RawToken = if reset {
       drop(current_tokens);