aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/hdb/ai-lists.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/hdb/ai-lists.cpp b/engines/hdb/ai-lists.cpp
index 2456812e09..d2ddd4ae3a 100644
--- a/engines/hdb/ai-lists.cpp
+++ b/engines/hdb/ai-lists.cpp
@@ -863,9 +863,11 @@ bool AI::checkTriggerList(char *entName, int x, int y) {
}
void AI::killTrigger(const char *id) {
- for (Common::Array<Trigger *>::iterator it = _triggerList->begin(); it != _triggerList->end(); it++) {
- if (!scumm_stricmp(id, (*it)->id))
- _triggerList->erase(it);
+ for (uint i = 0; i < _triggerList->size(); i++) {
+ if (!scumm_stricmp(id, _triggerList->operator[](i)->id)) {
+ _triggerList->remove_at(i);
+ i--;
+ }
}
}