However, that won't be the end of your problems. I wouldn't suggest using for loops here.
Whenever you delete an element from a vector, the vector gets smaller. What happens in the inner for loop when the vector's size becomes equal to i? What's more, when you erase an element every element is moved down one index. (When you erase vector[7], vector[8] becomes vector[7].) So you end up not checking some elements against other elements.
I would expect your code to look more like the following (disclaimer: Not tested, may require some minor adjustments to work correctly.)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
auto zombie = zombies.begin() ;
while ( zombie != zombies.end() )
{
(*zombie)->Move() ;
auto & bulletVec = player.ReturnVector() ;
auto bullet = bulletVec.begin() ;
while ( bullet != bulletVec.end() && !((*zombie)->RS().getGlobalBounds().contains(bullet->RS().getPosition())) )
++bullet ;
if ( bullet != bulletVec.end() )
{
zombie = zombies.erase(zombie) ;
bulletVec.erase(bullet) ;
}
else
++zombie ;
}
Also, I think the design would benefit from the bullets vector being divorced from the player object.