Thanks, the entire code below, i would like to stick with the vector container if at all possible, i have modified my loop/erase code to 'attempt' to re validate the iterator, but it still doesnt work.
Code:
for(vector<bomb>::iterator bm = bombs.begin(); bm!=bombs.end(); )
{
// Draw bomb
glRectd(bm->x1, bm->y1, bm->x2, bm->y2);
// Move bomb downards
bm->y1-= delta_time * BOMB_VELOCITY;
bm->y2-= delta_time * BOMB_VELOCITY;
// Check for impact
if((bm->x2 <= ship->RightX && bm->x1 >= ship->LeftX) && (bm->y2 <= ship->TopY && bm->y2 >= ship->LeftY))
{
// Impact occured
bm = bombs.erase(bm); // destroy bomb
ship->ship_destroy = true;
ship->lives--;
}
++bm;
}
This still segment faults :S
Thanks again