- else if (us == WHITE)
- {
- // Immediate win if a pawn can be promoted without getting captured
- if ( rank_of(psq) == RANK_7
- && wksq != psq + DELTA_N
- && ( square_distance(bksq, psq + DELTA_N) > 1
- ||(StepAttacksBB[KING][wksq] & (psq + DELTA_N))))
- result = WIN;
- }
+ // Immediate win if a pawn can be promoted without getting captured
+ else if ( us == WHITE
+ && rank_of(psq) == RANK_7
+ && ksq[us] != psq + NORTH
+ && ( distance(ksq[~us], psq + NORTH) > 1
+ || (StepAttacksBB[KING][ksq[us]] & (psq + NORTH))))
+ result = WIN;
+