Closed zackthehuman closed 9 years ago
The issue is that the end iterator is not being passed in when using the erase/remove
idiom in GameWorld
. This code:
activeEnemies.erase(
std::remove(std::begin(activeEnemies), std::end(activeEnemies), objectToBeRemoved));
Should really look like this:
activeEnemies.erase(
std::remove(std::begin(activeEnemies), std::end(activeEnemies), objectToBeRemoved),
std::end(activeEnemies)
);
Otherwise we're matching the wrong signature of erase
. I don't know how this was ever working :-1:
If you try to remove a game object that isn't actually owned by the
GameWorld
it will crash. Seems like it crashes while processing the removal queue.