Clear out the EP file when making a null move. Keeping the EP file can create some completely invalid moves that corrupt the game state when played/unplayed.
Clear out the EP file when making a null move. Keeping the EP file can create some completely invalid moves that corrupt the game state when played/unplayed.

Specific example is below; the offending move is an EP capture bxa3 (moving black pawn) which is played when it's *white's* turn. The result is an extra pawn appearing on a4.

Log from game, notice how the final position is wrong:

2016-04-01 21:14:27-0500	Current game state: r3kb1r/p3pp2/1qp2n1p/1p2n3/8/1BN1Q2P/PPPB1PP1/R4RK1 b kq - 1 14
2016-04-01 21:14:27-0500	Allocating 5.00s of think time.
2016-04-01 21:14:27-0500	Search starting with depth=10
..truncated output....
2016-04-01 21:14:30-0500	Improved score in deep search: Qxe3, -1.35
2016-04-01 21:14:30-0500	<<	8 -135 336 10264399 Qxe3
2016-04-01 21:14:36-0500	Out of time (8.51s > 5.00s)
....
2016-04-01 21:14:36-0500	<<	move Qxe3
2016-04-01 21:14:36-0500	Current game state: r3kb1r/p3pp2/2p2n1p/1p2n3/P7/1BN1q2P/PPPB1PP1/R4RK1 w kq - 0 15
...and later, an illegal move involving that piece
2016-04-01 21:14:37-0500	>>	Bxe3
2016-04-01 21:14:37-0500	Current game state: r3kb1r/p3pp2/2p2n1p/1p2n3/P7/1BN1B2P/PPP2PP1/R4RK1 b kq - 0 15
2016-04-01 21:14:42-0500	<<	move bxa4
2016-04-01 21:14:42-0500	Current game state: r3kb1r/p3pp2/2p2n1p/4n3/p7/1BN1B2P/PPP2PP1/R4RK1 w kq - 0 16

In xboard:
post
ics asdf
tellicsnoalias set note 2 CPU: Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz (4 cores)
tellicsnoalias set note 3 OS: 3.13.0-83-generic GNU/Linux
setboard r3kb1r/p3pp2/1qp2n1p/1p2n3/8/1BN1Q2P/PPPB1PP1/R4RK1 b kq - 1 14
go
1 60 0 1651 Qxe3
2 -22 1 7007 Qc7
3 140 3 22728 Qb8
4 -28 10 112154 Qxe3
5 105 69 965242 Qxe3
6 -31 410 5624724 Qxe3
8 -35 676 9949402 Qxe3
10 -35 676 9949402 Qxe3
move Qxe3
// At this point the position is corrupted.

wrocket/Tulip-Chess,wrocket/Tulip-Chess,wrocket/Tulip-Chess,wrocket/Tulip-Chess