1
0
mirror of https://github.com/taigrr/JSCheckers synced 2025-01-18 04:33:13 -08:00

Minor bugfix to disallow jumping your own pieces after a combo move

This commit is contained in:
Tai Groot 2015-08-18 11:27:10 -07:00
parent 24d0445642
commit 747b1cb69a

View File

@ -165,7 +165,7 @@ function movePiece(idName, XCoor, YCoor)
multPossible=false;
}
}
else if(((multPossible&&(lastUsed==(fromCol+'a'+fromRow)))||((fromType).substring(0,1)!=lastPlayer.substring(0,1)))&&(Math.abs(toRow-fromRow)<3)&&(Math.abs(toCol-fromCol)<3)&&((avType=='red')||(avType=='redK')||(avType=='black')||(avType=='blackK')))
else if(((multPossible&&(lastUsed==(fromCol+'a'+fromRow))&&avType.substring(0,1)!=fromType.substring(0,1))||((fromType).substring(0,1)!=lastPlayer.substring(0,1)))&&(Math.abs(toRow-fromRow)<3)&&(Math.abs(toCol-fromCol)<3)&&((avType=='red')||(avType=='redK')||(avType=='black')||(avType=='blackK')))
{
if((!(((fromType=='red')&&(toRow<fromRow))||((fromType=='black')&&(toRow>fromRow))))||(multPossible&&(lastUsed==(fromCol+'a'+fromRow))))
{