Check "wait until min distance to player" only for requiredTilesPresent wait condition

allJobsDone should wait even if "wait until min distance to player" is 0.
crashfix_debugdraw
elsid 2 years ago
parent 955db8f825
commit 180d609e0d
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -190,6 +190,9 @@ namespace
TEST_F(DetourNavigatorNavigatorTest, add_object_should_change_navmesh)
{
mSettings.mWaitUntilMinDistanceToPlayer = 0;
mNavigator.reset(new NavigatorImpl(mSettings, std::make_unique<NavMeshDb>(":memory:", std::numeric_limits<std::uint64_t>::max())));
const std::array<float, 5 * 5> heightfieldData {{
0, 0, 0, 0, 0,
0, -25, -25, -25, -25,

@ -256,12 +256,14 @@ namespace DetourNavigator
void AsyncNavMeshUpdater::waitUntilJobsDoneForNotPresentTiles(Loading::Listener& listener)
{
const int maxDistanceToPlayer = mSettings.get().mWaitUntilMinDistanceToPlayer;
if (maxDistanceToPlayer <= 0)
return;
const std::size_t initialJobsLeft = getTotalJobs();
std::size_t maxProgress = initialJobsLeft;
std::size_t prevJobsLeft = initialJobsLeft;
std::size_t jobsDone = 0;
std::size_t jobsLeft = 0;
const int maxDistanceToPlayer = mSettings.get().mWaitUntilMinDistanceToPlayer;
const TilePosition playerPosition = *mPlayerTile.lockConst();
const auto isDone = [&]
{

@ -154,8 +154,7 @@ namespace DetourNavigator
void NavigatorImpl::wait(Loading::Listener& listener, WaitConditionType waitConditionType)
{
if (mSettings.mWaitUntilMinDistanceToPlayer > 0)
mNavMeshManager.wait(listener, waitConditionType);
mNavMeshManager.wait(listener, waitConditionType);
}
SharedNavMeshCacheItem NavigatorImpl::getNavMesh(const AgentBounds& agentBounds) const

Loading…
Cancel
Save