Fixed enemies being invisible sometimes.
This commit is contained in:
parent
c94380c809
commit
bbb3153943
1 changed files with 2 additions and 2 deletions
|
@ -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 {
|
||||||
|
|
Reference in a new issue