Skip to content

Commit 08756c3

Browse files
committed
Dont MovePointToGround if there's no ground beneath us
1 parent 3367d0a commit 08756c3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Managers/SceneMan.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2405,6 +2405,12 @@ Vector SceneMan::MovePointToGround(const Vector &from, int maxAltitude, int accu
24052405
ForceBounds(temp);
24062406

24072407
float altitude = FindAltitude(temp, g_SceneMan.GetSceneHeight(), accuracy);
2408+
2409+
// If there's no ground beneath us, do nothing
2410+
if (altitude == g_SceneMan.GetSceneHeight()) {
2411+
return temp;
2412+
}
2413+
24082414
// Only move down if we're above the maxAltitude over the ground
24092415
Vector groundPoint(temp.m_X, temp.m_Y + (altitude > maxAltitude ? altitude - maxAltitude : 0));
24102416
return groundPoint;

0 commit comments

Comments
 (0)