@@ -1082,32 +1082,11 @@ void Actor::OnNewMovePath() {
10821082 m_MoveTarget = m_PrevPathTarget = m_Pos;
10831083 }
10841084
1085- if (!m_MovePath.empty ()) {
1086- // Smash all non-airborne waypoints down to just above the ground, so they more accurately represent the ground path
1087- std::list<Vector>::iterator finalItr = m_MovePath.end ();
1088- finalItr--;
1089- Vector smashedPoint;
1090- Vector previousPoint = *(m_MovePath.begin ());
1091- std::list<Vector>::iterator nextItr = m_MovePath.begin ();
1092- for (std::list<Vector>::iterator lItr = m_MovePath.begin (); lItr != finalItr; ++lItr) {
1093- nextItr++;
1094- smashedPoint = g_SceneMan.MovePointToGround ((*lItr), m_CharHeight * 0.2 , 0 , g_SettingsMan.GetPathFinderGridNodeSize () * 2 .0f );
1095-
1096- // Only smash if the new location doesn't cause the path to intersect hard terrain ahead or behind of it
1097- // Try three times to halve the height to see if that won't intersect
1098- for (int i = 0 ; i < 3 ; i++) {
1099- Vector notUsed;
1100- if (!g_SceneMan.CastStrengthRay (previousPoint, smashedPoint - previousPoint, 5 , notUsed, 3 , g_MaterialDoor) &&
1101- nextItr != m_MovePath.end () && !g_SceneMan.CastStrengthRay (smashedPoint, (*nextItr) - smashedPoint, 5 , notUsed, 3 , g_MaterialDoor)) {
1102- (*lItr) = smashedPoint;
1103- break ;
1104- } else {
1105- smashedPoint.m_Y -= ((smashedPoint.m_Y - (*lItr).m_Y ) / 2 );
1106- }
1107- }
1108-
1109- previousPoint = (*lItr);
1110- }
1085+ // Smash all non-airborne waypoints down to just above the ground, so they more accurately represent the ground path
1086+ std::list<Vector>::iterator finalItr = m_MovePath.end ();
1087+ --finalItr;
1088+ for (std::list<Vector>::iterator lItr = m_MovePath.begin (); lItr != finalItr; ++lItr) {
1089+ (*lItr) = g_SceneMan.MovePointToGround ((*lItr), m_CharHeight * 0.2 , 0 , g_SettingsMan.GetPathFinderGridNodeSize () * 2 .5f );
11111090 }
11121091}
11131092
0 commit comments