@@ -71,7 +71,7 @@ static int s_practice_mode = FALSE;
7171static const char * s_forced_opening_seq = NULL ;
7272static int s_use_book = TRUE;
7373static int s_enable_msg = TRUE;
74- static int s_undo_stack [64 ];
74+ static int s_undo_stack [120 ]; //60 black and 60 White Moves. A move can be "PASS"
7575static int s_undo_stack_pointer = 0 ;
7676// --
7777
@@ -1017,15 +1017,15 @@ void _droidzebra_undo_turn(int* side_to_move)
10171017// undo moves until player is a human and he can make a move
10181018void _droidzebra_undo_all (int * side_to_move )
10191019{
1020- int curr_move ;
1020+ int curr_move ;
10211021
1022+ //already at the beginning
10221023 if (score_sheet_row == 0 && * side_to_move == BLACKSQ ) return ;
10231024
1024-
1025-
10261025 do {
10271026 _droidzebra_undo_stack_push (disks_played );
1028- * side_to_move = OPP (* side_to_move );
1027+
1028+ * side_to_move = OPP (* side_to_move );
10291029
10301030 if ( * side_to_move == WHITESQ )
10311031 score_sheet_row -- ;
@@ -1042,7 +1042,7 @@ void _droidzebra_undo_all(int* side_to_move)
10421042 black_moves [score_sheet_row ] = PASS ;
10431043 }
10441044
1045- droidzebra_message_debug ("undo : side_to_move %d, undo_move %d, score_sheet_row %d, disks_played %d, move_count %d" , * side_to_move , curr_move , score_sheet_row , disks_played , move_count [disks_played ]);
1045+ droidzebra_message_debug ("undoall : side_to_move %d, undo_move %d, score_sheet_row %d, disks_played %d, move_count %d" , * side_to_move , curr_move , score_sheet_row , disks_played , move_count [disks_played ]);
10461046 } while ( !(score_sheet_row == 0 && * side_to_move == BLACKSQ ));
10471047 clear_endgame_performed ();
10481048}
@@ -1124,7 +1124,7 @@ void _droidzebra_throw_engine_error(JNIEnv* env, const char* msg)
11241124
11251125void _droidzebra_undo_stack_push (int val )
11261126{
1127- assert (s_undo_stack_pointer < 64 );
1127+ assert (s_undo_stack_pointer < 120 );
11281128 s_undo_stack [s_undo_stack_pointer ++ ] = val ;
11291129}
11301130
0 commit comments