[Super-tux-commit] supertux/src leveleditor.cpp,1.68,1.69
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-04-28 20:07:43
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32468 Modified Files: leveleditor.cpp Log Message: MatzeBs patch for evil cast Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.68 retrieving revision 1.69 diff -u -d -r1.68 -r1.69 --- leveleditor.cpp 28 Apr 2004 18:45:24 -0000 1.68 +++ leveleditor.cpp 28 Apr 2004 20:07:20 -0000 1.69 @@ -1193,10 +1193,16 @@ y2 /= 32; /* if there is a bad guy over there, remove it */ - for(i = 0; i < le_world.bad_guys.size(); ++i) - if(le_world.bad_guys[i].base.x/32 >= x1 && le_world.bad_guys[i].base.x/32 <= x2 - && le_world.bad_guys[i].base.y/32 >= y1 && le_world.bad_guys[i].base.y/32 <= y2) - le_world.bad_guys.erase(static_cast<std::vector<BadGuy>::iterator>(&le_world.bad_guys[i])); + for(std::vector<BadGuy>::iterator i = le_world.bad_guys.begin(); + i != le_world.bad_guys.end(); /* will be at end of loop */) { + if(i->base.x/32 >= x1 && i->base.x/32 <= x2 + && i->base.y/32 >= y1 && i->base.y/32 <= y2) { + i = le_world.bad_guys.erase(i); + continue; + } else { + ++i; + } + } for(xx = x1; xx <= x2; xx++) for(yy = y1; yy <= y2; yy++) |