diff --git a/Runtime/Camera/CCameraManager.cpp b/Runtime/Camera/CCameraManager.cpp index 32f185d92..8ea777feb 100644 --- a/Runtime/Camera/CCameraManager.cpp +++ b/Runtime/Camera/CCameraManager.cpp @@ -655,9 +655,9 @@ bool CCameraManager::HasBallCameraInitialPositionHint(CStateManager& mgr) const } void CCameraManager::RemoveCinemaCamera(TUniqueId uid, CStateManager& mgr) { - const auto search = std::find(x4_cineCameras.begin(), x4_cineCameras.end(), uid); + const auto search = std::find(x4_cineCameras.cbegin(), x4_cineCameras.cend(), uid); - if (search == x4_cineCameras.end()) { + if (search == x4_cineCameras.cend()) { return; } @@ -671,10 +671,10 @@ void CCameraManager::DeleteCameraHint(TUniqueId id, CStateManager& mgr) { return; } - const auto search = std::find_if(x2b0_inactiveCameraHints.begin(), x2b0_inactiveCameraHints.end(), + const auto search = std::find_if(x2b0_inactiveCameraHints.cbegin(), x2b0_inactiveCameraHints.cend(), [id](TUniqueId tid) { return tid == id; }); - if (search != x2b0_inactiveCameraHints.end()) { + if (search != x2b0_inactiveCameraHints.cend()) { return; } @@ -687,9 +687,9 @@ void CCameraManager::DeleteCameraHint(TUniqueId id, CStateManager& mgr) { void CCameraManager::AddInactiveCameraHint(TUniqueId id, CStateManager& mgr) { if (const TCastToConstPtr hint = mgr.ObjectById(id)) { - const auto search = std::find_if(x2b0_inactiveCameraHints.begin(), x2b0_inactiveCameraHints.end(), + const auto search = std::find_if(x2b0_inactiveCameraHints.cbegin(), x2b0_inactiveCameraHints.cend(), [id](TUniqueId tid) { return tid == id; }); - if (search == x2b0_inactiveCameraHints.end() && x2b0_inactiveCameraHints.size() != 64) { + if (search == x2b0_inactiveCameraHints.cend() && x2b0_inactiveCameraHints.size() != 64) { x2b0_inactiveCameraHints.push_back(id); } } @@ -697,9 +697,9 @@ void CCameraManager::AddInactiveCameraHint(TUniqueId id, CStateManager& mgr) { void CCameraManager::AddActiveCameraHint(TUniqueId id, CStateManager& mgr) { if (const TCastToConstPtr hint = mgr.ObjectById(id)) { - const auto search = std::find_if(x334_activeCameraHints.begin(), x334_activeCameraHints.end(), + const auto search = std::find_if(x334_activeCameraHints.cbegin(), x334_activeCameraHints.cend(), [id](TUniqueId tid) { return tid == id; }); - if (search == x334_activeCameraHints.end() && xac_cameraHints.size() != 64 && x334_activeCameraHints.size() != 64) { + if (search == x334_activeCameraHints.cend() && xac_cameraHints.size() != 64 && x334_activeCameraHints.size() != 64) { x334_activeCameraHints.push_back(id); } } diff --git a/Runtime/Camera/CCameraSpline.cpp b/Runtime/Camera/CCameraSpline.cpp index 471608f65..52e5d5a9f 100644 --- a/Runtime/Camera/CCameraSpline.cpp +++ b/Runtime/Camera/CCameraSpline.cpp @@ -18,13 +18,13 @@ void CCameraSpline::CalculateKnots(TUniqueId cameraId, const std::vector waypoint = mgr.ObjectById(mgr.GetIdForScript(lastConn->x8_objId)); + TCastToConstPtr waypoint = mgr.ObjectById(mgr.GetIdForScript(lastConn->x8_objId)); x14_wpTracker.clear(); x14_wpTracker.reserve(4); while (waypoint) { - auto search = std::find_if(x14_wpTracker.begin(), x14_wpTracker.end(), - [&waypoint](const auto& a) { return a == waypoint->GetUniqueId(); }); - if (search == x14_wpTracker.end()) { + const auto search = std::find_if(x14_wpTracker.cbegin(), x14_wpTracker.cend(), + [&waypoint](const auto& a) { return a == waypoint->GetUniqueId(); }); + if (search == x14_wpTracker.cend()) { x14_wpTracker.push_back(waypoint->GetUniqueId()); waypoint = mgr.ObjectById(waypoint->GetRandomNextWaypointId(mgr)); } @@ -34,9 +34,9 @@ void CCameraSpline::CalculateKnots(TUniqueId cameraId, const std::vectorx8_objId)); while (waypoint) { - auto search = std::find_if(x14_wpTracker.begin(), x14_wpTracker.end(), - [&waypoint](const auto& a) { return a == waypoint->GetUniqueId(); }); - if (search == x14_wpTracker.end()) { + const auto search = std::find_if(x14_wpTracker.cbegin(), x14_wpTracker.cend(), + [&waypoint](const auto& a) { return a == waypoint->GetUniqueId(); }); + if (search == x14_wpTracker.cend()) { x14_wpTracker.push_back(waypoint->GetUniqueId()); AddKnot(waypoint->GetTranslation(), waypoint->GetTransform().basis[1]); waypoint = mgr.ObjectById(waypoint->GetRandomNextWaypointId(mgr));