@@ -570,8 +570,9 @@ Controller::InputMode Actor::SwapControllerModes(Controller::InputMode newMode,
570
570
}
571
571
572
572
bool Actor::Look (float FOVSpread, float range) {
573
- if (!g_SceneMan.AnythingUnseen (m_Team) || m_CanRevealUnseen == false )
573
+ if (!g_SceneMan.AnythingUnseen (m_Team) || m_CanRevealUnseen == false ) {
574
574
return false ;
575
+ }
575
576
576
577
// Use the 'eyes' on the 'head', if applicable
577
578
Vector aimPos = GetEyePos ();
@@ -1090,12 +1091,18 @@ void Actor::Update() {
1090
1091
m_ViewPoint = m_Pos;
1091
1092
1092
1093
// "See" the location and surroundings of this actor on the unseen map
1093
- if (m_Status != Actor::INACTIVE)
1094
- Look (45 * m_Perceptiveness, g_FrameMan.GetPlayerScreenWidth () * 0.51 * m_Perceptiveness);
1094
+ // Todo - split MT safe and potentially expensive stuff like this in a seperate ThreadedUpdate for the C++ side
1095
+ if (m_Status != Actor::INACTIVE) {
1096
+ const int lookIterations = 6 ; // How many see rays to cast per frame
1097
+ for (int i = 0 ; i < lookIterations; ++i) {
1098
+ Look (45 * m_Perceptiveness, g_FrameMan.GetPlayerScreenWidth () * 0.51 * m_Perceptiveness);
1099
+ }
1100
+ }
1095
1101
1096
1102
// Check if the MO we're following still exists, and if not, then clear the destination
1097
- if (m_pMOMoveTarget && !g_MovableMan.ValidMO (m_pMOMoveTarget))
1103
+ if (m_pMOMoveTarget && !g_MovableMan.ValidMO (m_pMOMoveTarget)) {
1098
1104
m_pMOMoveTarget = 0 ;
1105
+ }
1099
1106
1100
1107
// /////////////////////////////////////////////////////////////////////////////
1101
1108
// Check for manual player-made progress made toward the set AI goal
0 commit comments