Round doesn't make sense

This commit is contained in:
Patricia Aas 2021-07-06 17:11:49 +02:00
parent 9bea9fdad9
commit 742f4ce56a

View file

@ -68,10 +68,10 @@ void PacMan::updateMazePosition(std::chrono::milliseconds time_delta, const Boar
const size_t right = COLUMNS - 1;
const size_t left = 0;
if (std::round(pos.x) == right && direction == Direction::RIGHT) {
if (std::size_t(pos.x) == right && direction == Direction::RIGHT) {
pos.x = left;
return;
} else if (std::round(pos.x) == left && direction == Direction::LEFT) {
} else if (std::size_t(pos.x) == left && direction == Direction::LEFT) {
pos.x = right;
return;
}