diff --git a/src/Dames/Dames.cpp b/src/Dames/Dames.cpp index b6520c8..a540378 100644 --- a/src/Dames/Dames.cpp +++ b/src/Dames/Dames.cpp @@ -69,12 +69,12 @@ void Dames::event(const int x, const int y) { Ecran::printMessage("Vous devez forcément faire une prise."); if (plateau.priseValide(posCurseur.first, posCurseur.second)) { if (p == nullptr) { - plateau.moveSelection(posCurseur.first, posCurseur.second); // On efface la piece prise du plateau Piece *pieceEffacee = plateau.piecePrise(posCurseur.first, posCurseur.second); plateau.modifierPlateau(pieceEffacee->getPos().first, pieceEffacee->getPos().second, nullptr); + plateau.moveSelection(posCurseur.first, posCurseur.second); // Donne la main au joueur suivant changerJoueurCourant(); Ecran::printMessage(msgTonTour()); diff --git a/src/Dames/PlateauDames.cpp b/src/Dames/PlateauDames.cpp index b7ca016..b248811 100644 --- a/src/Dames/PlateauDames.cpp +++ b/src/Dames/PlateauDames.cpp @@ -28,16 +28,16 @@ PlateauDames::~PlateauDames() {} Piece *PlateauDames::piecePrise(const int x, const int y) const { const Position posInitiale = selection->getPos(); if (x == posInitiale.first + 2 && y == posInitiale.second + 2) { - return plateau[x + 1][y + 1]; + return plateau[posInitiale.first + 1][posInitiale.second + 1]; } if (x == posInitiale.first - 2 && y == posInitiale.second - 2) { - return plateau[x - 1][y - 1]; + return plateau[posInitiale.first - 1][posInitiale.second - 1]; } if (x == posInitiale.first + 2 && y == posInitiale.second - 2) { - return plateau[x + 1][y - 1]; + return plateau[posInitiale.first + 1][posInitiale.second - 1]; } if (x == posInitiale.first - 2 && y == posInitiale.second + 2) { - return plateau[x - 1][y + 1]; + return plateau[posInitiale.first - 1][posInitiale.second + 1]; } return nullptr; }