Bug 231

Summary: Wrong return value of move of pawn
Product: CS3343 group25 chess game Reporter: Andy <dotafterfootball>
Component: chess gameAssignee: HUANG Xiaofeng <xhuang227-c>
Status: CONFIRMED ---    
Severity: enhancement    
Priority: ---    
Version: unspecified   
Hardware: PC   
OS: Mac OS   
Attachments: Bug

Description Andy 2017-11-29 16:22:32 HKT
Created attachment 9 [details]
Bug

if(board.getPiece(target_x, target_y).getColor()){
			if(x==4){
				if(target_x-x==1&&Math.abs(target_y-y)==1){
					Piece piece=board.getPiece(x,target_y);
					if(piece!=null)
						if(piece instanceof Pawn&&((Pawn) piece).bepassant()){
							return true;
					}
				}
			}
		}

In board.getPiece() function, there should be (x,y) instead of target_x and target_y. Or it will result in nullpointer exception.