prevent loop when none input
This commit is contained in:
		
							parent
							
								
									5dc2457a15
								
							
						
					
					
						commit
						c0ce3b7bff
					
				@ -1,7 +1,7 @@
 | 
			
		||||
#![allow(dead_code)]
 | 
			
		||||
 | 
			
		||||
/// Manage UCI messages and link into chess component
 | 
			
		||||
mod uci_command;
 | 
			
		||||
pub mod uci_command;
 | 
			
		||||
 | 
			
		||||
use log::{info, warn};
 | 
			
		||||
use std::io::*;
 | 
			
		||||
@ -63,10 +63,12 @@ impl<Fi: Read, Fo:  Write> UciEngine<Fi, Fo> {
 | 
			
		||||
        self.push(GuiCommand::Uci);
 | 
			
		||||
 | 
			
		||||
        // Consume commands until uciok messages
 | 
			
		||||
        if self.source.is_some() {
 | 
			
		||||
            while !self.uciok {
 | 
			
		||||
                self.pull();
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// Initialize a new game
 | 
			
		||||
    ///
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user