Skip to content

Commit cc4eb59

Browse files
committed
Force UpdateMovePath to take at least 1 frame
1 parent 8841e8c commit cc4eb59

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Source/Entities/Actor.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,15 +1287,17 @@ void Actor::OnNewMovePath() {
12871287
//////////////////////////////////////////////////////////////////////////////////////////
12881288

12891289
void Actor::PreControllerUpdate() {
1290-
if (m_UpdateMovePath) {
1291-
UpdateMovePath();
1292-
}
1293-
12941290
if (m_PathRequest && m_PathRequest->complete) {
12951291
m_MovePath = const_cast<std::list<Vector> &>(m_PathRequest->path);
12961292
m_PathRequest.reset();
12971293
OnNewMovePath();
12981294
}
1295+
1296+
// We update this after, because pathing requests are forced to take at least 1 frame for the sake of determinism for now.
1297+
// In future maybe we can move this back, but it doesn't make much difference (the threadpool submission overhead makes it extremely unlikely that it would complete in less time anyways)
1298+
if (m_UpdateMovePath) {
1299+
UpdateMovePath();
1300+
}
12991301
}
13001302

13011303
//////////////////////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)