diff --git a/src/Safari/PlateauSafari.cpp b/src/Safari/PlateauSafari.cpp index 3a11f72..ad07b82 100644 --- a/src/Safari/PlateauSafari.cpp +++ b/src/Safari/PlateauSafari.cpp @@ -156,23 +156,22 @@ bool PlateauSafari::deplacementValide(const int x, const int y) const { Position posInitiale = selection->getPos(); // Vérifier qu'il n'y a pas de barrière sur le chemin - // TODO: Ya des bugs a fix ici for (PieceSafari *barriere : barrieres) { Position pos1 = barriere->getPos(); Position pos2 = barriere->getPos2(); // Plus lointaine position en fonction de l'orientation - PositionMutable posBarriere; // todo + std::pair posBarriere; // Verticale if (pos1.first == pos2.first) { posBarriere = - std::make_pair(pos1.first, std::max(pos1.second, pos2.second)); + std::make_pair(pos1.first, std::min(pos1.second, pos2.second) + 0.5); } // Horizontale else { posBarriere = - std::make_pair(std::max(pos1.first, pos2.first), pos1.second); + std::make_pair(std::min(pos1.first, pos2.first) + 0.5, pos1.second); } // Vérifier les conditions pour le point posBarriere sur