diff --git a/src/Game.cpp b/src/Game.cpp index 71502b4..80ce358 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -176,7 +176,11 @@ void Game::moveBullets() hitTank(tankIter, bulletIter->getPower()); valid = false; } - bulletIter = (valid ? ++bulletIter : bullets_.erase(bulletIter)); + + if (valid) + ++bulletIter; + else + bulletIter = bullets_.erase(bulletIter); } }