Fixed enemies being invisible sometimes.

This commit is contained in:
Felix Ableitner 2013-09-17 19:32:30 +02:00
parent c94380c809
commit bbb3153943

View file

@ -121,9 +121,9 @@ World::applyMovement(std::shared_ptr<Sprite> sprite, int elapsed) {
void void
World::think(int elapsed) { World::think(int elapsed) {
for (auto it = mCharacters.begin(); it != mCharacters.end(); ) { for (auto it = mCharacters.begin(); it != mCharacters.end(); ) {
if ((*it)->getDelete()) { if ((*it)->getDelete() && (*it)->getCategory() != Sprite::CATEGORY_ACTOR) {
mCharacters.erase(it); mCharacters.erase(it);
auto& d = mDrawables[Sprite::CATEGORY_ACTOR]; auto& d = mDrawables[(*it)->getCategory()];
d.erase(std::find(d.begin(), d.end(), *it)); d.erase(std::find(d.begin(), d.end(), *it));
} }
else { else {