• Advertisement
Sign in to follow this  
  • entries
  • comments
  • views


Sign in to follow this  


Why the hell did I not see this sooner -
	void killTileType( TileType type ) {
for ( TileList::iterator i = _tiles.begin(); i != _tiles.end(); ++i ) {
if ( (*i) == type ) {
(*i) = NULL;

} else {

And I was wondering why my iterator was falling off the edge. LOL!

Needless to say, deleting tiles from a tileset when they are currently in use no longer crashes the whole program. But it will delete those tiles from your map, which may or may not be what you wanted to have done. And thanks to matTd for kindly pointing out that I'm an idiot. Its always appreciated :D
Sign in to follow this  


Recommended Comments

I guess this was a do while loop before hence the stay ++i in the for loop body :OP

Gotta love iterators :O)

Share this comment

Link to comment
I honestly don't remember. I think I was possibly drunk when I wrote that :P

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement