diff --git a/Runtime/Camera/CCameraManager.cpp b/Runtime/Camera/CCameraManager.cpp index 0483eed35..4ee95c092 100644 --- a/Runtime/Camera/CCameraManager.cpp +++ b/Runtime/Camera/CCameraManager.cpp @@ -1,5 +1,7 @@ #include "Runtime/Camera/CCameraManager.hpp" +#include + #include "Runtime/CStateManager.hpp" #include "Runtime/GameGlobalObjects.hpp" #include "Runtime/Camera/CBallCamera.hpp" @@ -38,11 +40,12 @@ zeus::CTransform CCameraManager::GetCurrentCameraTransform(const CStateManager& } void CCameraManager::RemoveCameraShaker(u32 id) { - for (auto it = x14_shakers.begin(); it != x14_shakers.end(); ++it) - if (it->xbc_shakerId == id) { - x14_shakers.erase(it); - break; - } + const auto iter = std::find_if(x14_shakers.cbegin(), x14_shakers.cend(), + [id](const auto& shaker) { return shaker.xbc_shakerId == id; }); + if (iter == x14_shakers.cend()) { + return; + } + x14_shakers.erase(iter); } int CCameraManager::AddCameraShaker(const CCameraShakeData& data, bool sfx) {