void EntityList::ClearTrapPointers() { auto it = trap_list.begin(); while (it != trap_list.end()) { Trap* cur = it->second; if (cur->IsTrap()) { cur->DestroyHiddenTrigger(); } ++it; } }