if flag f2:
if moved == K:
move $dest $origin; // Temporarily undo King move
if sub checked $origin:
if not or checkleap $origin $dest 1 0 checkleap $origin $dest 1 1:
die A King may not use the special moves out of check.;
endif;
endif;
move $origin $dest;
endif;
endif;
The way this goes wrong is that other pieces other than the king are affected by it. Any idea why?
@Fergus,
I have moved the buggy code back to the old testing ground:
https://www.chessvariants.com/play/pbm/play.php?game=Apothecary+Chess+1&settings=Apothecary1working&submit=Edit
if flag f2:
if moved == K:
move $dest $origin; // Temporarily undo King move
if sub checked $origin:
if not or checkleap $origin $dest 1 0 checkleap $origin $dest 1 1:
die A King may not use the special moves out of check.;
endif;
endif;
move $origin $dest;
endif;
endif;
The way this goes wrong is that other pieces other than the king are affected by it. Any idea why?