@@ -4264,24 +4264,22 @@ function findPremoveChild(exploration: Exploration[] | null | undefined): Explor
42644264}
42654265
42664266// Helper to apply forced moves (automove/autopass) and return true if any were applied
4267- function applyForcedMove ( engine : GameBase , flags : string [ ] ) : string {
4267+ function findForcedMove ( engine : GameBase , flags : string [ ] ) : string {
42684268 let forcedMove = null ;
42694269 if ( flags !== undefined && flags . includes ( "automove" ) && ! engine . gameover ) {
42704270 // @ts -ignore
42714271 if ( engine . moves ( ) . length === 1 && ! ( flags . includes ( "pie-even" ) && engine . state ( ) . stack . length === 2 ) ) {
42724272 // @ts -ignore
42734273 forcedMove = engine . moves ( ) [ 0 ] ;
4274- console . log ( `Applying forced move: ${ forcedMove } ` ) ;
4275- engine . move ( forcedMove ) ;
4274+ console . log ( `Found forced move: ${ forcedMove } ` ) ;
42764275 }
42774276 } else if ( flags !== undefined && flags . includes ( "autopass" ) && ! engine . gameover ) {
42784277 // @ts -ignore
42794278 if ( engine . moves ( ) . length === 1 && engine . moves ( ) [ 0 ] === "pass" && ! ( flags . includes ( "pie-even" ) && engine . state ( ) . stack . length === 2 ) ) {
42804279 console . log ( `Applying forced pass` ) ;
42814280 // @ts -ignore
42824281 forcedMove = engine . moves ( ) [ 0 ] ;
4283- console . log ( `Applying forced move: ${ forcedMove } ` ) ;
4284- engine . move ( forcedMove ) ;
4282+ console . log ( `Found forced move: ${ forcedMove } ` ) ;
42854283 }
42864284 }
42874285 return forcedMove ;
@@ -4324,7 +4322,7 @@ function applyMove(
43244322 explorations [ 1 ] = findExplorationChild ( explorations [ 1 ] , move , engine ) ?. children || null ;
43254323
43264324 // First, apply any forced moves (automove/autopass)
4327- move = applyForcedMove ( engine , flags ) ;
4325+ move = findForcedMove ( engine , flags ) ;
43284326 if ( ! move ) {
43294327 // Check if there's a premove for the current player
43304328 // @ts -ignore
0 commit comments