Skip to content

Commit 3ba633f

Browse files
committed
Fix camera glitch when reloading or strafing
1 parent 2a91825 commit 3ba633f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/xrEngine/CameraManager.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void CCameraManager::UpdateDeffered()
8686
RemoveCamEffector((*it)->eType);
8787

8888
if ((*it)->AbsolutePositioning())
89-
m_EffectorsCam.push_front(*it);
89+
m_EffectorsCam.insert(m_EffectorsCam.begin(), *it);
9090
else
9191
m_EffectorsCam.push_back(*it);
9292
}
@@ -247,9 +247,8 @@ void CCameraManager::UpdateCamEffectors()
247247
{
248248
if (m_EffectorsCam.empty())
249249
return;
250-
EffectorCamVec::reverse_iterator rit = m_EffectorsCam.rbegin();
251-
for (; rit != m_EffectorsCam.rend(); ++rit)
252-
ProcessCameraEffector(*rit);
250+
for (int i = m_EffectorsCam.size() - 1; i >= 0; --i)
251+
ProcessCameraEffector(m_EffectorsCam[i]);
253252

254253
m_cam_info.d.normalize();
255254
m_cam_info.n.normalize();

src/xrEngine/CameraManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "CameraDefs.h"
44
#include "xrCore/PostProcess/PPInfo.hpp"
55

6-
using EffectorCamVec = xr_list<CEffectorCam*>;
6+
using EffectorCamVec = xr_vector<CEffectorCam*>;
77
using EffectorPPVec = xr_vector<CEffectorPP*>;
88

99
#define effCustomEffectorStartID 10000

0 commit comments

Comments
 (0)