File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -298,13 +298,19 @@ export abstract class Position {
298
298
piece . role = promote ( this . rules ) ( role ) || role ;
299
299
300
300
const capture = this . board . set ( md . to , piece ) ,
301
- secondCapture = defined ( md . midStep ) ? this . board . take ( md . midStep ) : undefined ;
301
+ midCapture = defined ( md . midStep ) ? this . board . take ( md . midStep ) : undefined ;
302
+
303
+ // process midCapture (if exists) before final destination capture
304
+ if ( defined ( midCapture ) ) {
305
+ if ( ! lionRoles . includes ( role ) && midCapture . color === this . turn && lionRoles . includes ( midCapture . role ) )
306
+ this . lastLionCapture = md . midStep ;
307
+ this . storeCapture ( midCapture ) ;
308
+ }
302
309
if ( capture ) {
303
310
if ( ! lionRoles . includes ( role ) && capture . color === this . turn && lionRoles . includes ( capture . role ) )
304
311
this . lastLionCapture = md . to ;
305
312
this . storeCapture ( capture ) ;
306
313
}
307
- if ( defined ( secondCapture ) ) this . storeCapture ( secondCapture ) ;
308
314
}
309
315
}
310
316
}
You can’t perform that action at this time.
0 commit comments