Bug 230 - Incorrect undo result for some special condition
Summary: Incorrect undo result for some special condition
Status: CONFIRMED
Alias: None
Product: CS3343 group25 chess game
Classification: Unclassified
Component: chess game (show other bugs)
Version: unspecified
Hardware: PC Mac OS
: --- critical
Assignee: Andy
URL:
Depends on:
Blocks:
 
Reported: 2017-11-29 10:42 HKT by Andy
Modified: 2023-11-30 17:29 HKT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andy 2017-11-29 10:42:44 HKT
Relating code:

public void undo() {
		chessboard.initialize(x, y, chessboard.getPiece(x_target, y_target));
		chessboard.initialize(x_target, y_target, piece);
		addRedoCommand(this);
}

This is the undo function in CmdMove class. It will result in incorrect undo results in some cases like a pawn changes to queen since it only undo the position information instead of the full information of pieces.