diff options
-rw-r--r-- | engines/hdb/ai-funcs.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/hdb/ai-funcs.cpp b/engines/hdb/ai-funcs.cpp index 56239c80e0..761f74d4f4 100644 --- a/engines/hdb/ai-funcs.cpp +++ b/engines/hdb/ai-funcs.cpp @@ -669,7 +669,11 @@ int AI::checkForTouchplate(int x, int y) { } void AI::removeEntity(AIEntity *e) { - _ents->erase(&e); + for (int i = 0; i < _ents->size(); i++) + if (_ents->operator[](i) == e) { + _ents->remove_at(i); + return; + } } void AI::setEntityGoal(AIEntity *e, int x, int y) { |