diff --git a/Source/Contents/NavigationRequest.cpp b/Source/Contents/NavigationRequest.cpp index f1ea6aa7d..d26eaba62 100644 --- a/Source/Contents/NavigationRequest.cpp +++ b/Source/Contents/NavigationRequest.cpp @@ -13,9 +13,11 @@ // OFFSET: 0x00B8C0B0 // FUNCTION: fn_19420 __declspec(noinline) CNavi_Object* FindNaviObjectByName(const char* name, const std::vector& objects) { - for (CNavi_Object* object : objects) { - if (name && std::string(name) == object->name) { - return object; + for (std::vector::const_iterator it = objects.begin(); it != objects.end(); ++it) { + if (name) { + if ((*it)->name == std::string(name)) { + return *it; + } } } return nullptr;