I think you should use it in your handling routines. After constructing source2 and dest2 you should test if these are legal, and if not, do continuemove + return to abort further processing. And perhaps alter the legalmoves to those of the remaining piece.
I think you should use it in your handling routines. After constructing source2 and dest2 you should test if these are legal, and if not, do continuemove + return to abort further processing. And perhaps alter the legalmoves to those of the remaining piece.