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;
Fergus,
I have solved it:
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;