Skip to content

Commit 6f06423

Browse files
committed
Hopeful fix to pathfinding issues when navigatable areas are changed
1 parent e3af1a5 commit 6f06423

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Entities/Scene.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "FrameMan.h"
1919
#include "ConsoleMan.h"
2020
#include "SettingsMan.h"
21+
#include "ThreadMan.h"
2122
#include "MetaMan.h"
2223
#include "ContentFile.h"
2324
#include "SLTerrain.h"
@@ -3123,6 +3124,9 @@ void Scene::Update()
31233124
}
31243125

31253126
if (m_NavigatableAreasUpToDate == false) {
3127+
// Need to block until all current pathfinding requests are finished. Ugh, if only we had a better way (interrupt/cancel a path request to start a new one?)
3128+
g_ThreadMan.GetBackgroundThreadPool().wait_for_tasks();
3129+
31263130
m_NavigatableAreasUpToDate = true;
31273131
for (int team = Activity::Teams::NoTeam; team < Activity::Teams::MaxTeamCount; ++team) {
31283132
PathFinder& pathFinder = *GetPathFinder(static_cast<Activity::Teams>(team));

0 commit comments

Comments
 (0)