@@ -71,7 +71,7 @@ static int s_practice_mode = FALSE;
71
71
static const char * s_forced_opening_seq = NULL ;
72
72
static int s_use_book = TRUE;
73
73
static 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"
75
75
static int s_undo_stack_pointer = 0 ;
76
76
// --
77
77
@@ -1017,15 +1017,15 @@ void _droidzebra_undo_turn(int* side_to_move)
1017
1017
// undo moves until player is a human and he can make a move
1018
1018
void _droidzebra_undo_all (int * side_to_move )
1019
1019
{
1020
- int curr_move ;
1020
+ int curr_move ;
1021
1021
1022
+ //already at the beginning
1022
1023
if (score_sheet_row == 0 && * side_to_move == BLACKSQ ) return ;
1023
1024
1024
-
1025
-
1026
1025
do {
1027
1026
_droidzebra_undo_stack_push (disks_played );
1028
- * side_to_move = OPP (* side_to_move );
1027
+
1028
+ * side_to_move = OPP (* side_to_move );
1029
1029
1030
1030
if ( * side_to_move == WHITESQ )
1031
1031
score_sheet_row -- ;
@@ -1042,7 +1042,7 @@ void _droidzebra_undo_all(int* side_to_move)
1042
1042
black_moves [score_sheet_row ] = PASS ;
1043
1043
}
1044
1044
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 ]);
1046
1046
} while ( !(score_sheet_row == 0 && * side_to_move == BLACKSQ ));
1047
1047
clear_endgame_performed ();
1048
1048
}
@@ -1124,7 +1124,7 @@ void _droidzebra_throw_engine_error(JNIEnv* env, const char* msg)
1124
1124
1125
1125
void _droidzebra_undo_stack_push (int val )
1126
1126
{
1127
- assert (s_undo_stack_pointer < 64 );
1127
+ assert (s_undo_stack_pointer < 120 );
1128
1128
s_undo_stack [s_undo_stack_pointer ++ ] = val ;
1129
1129
}
1130
1130
0 commit comments