mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
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.
This commit is contained in:
parent
955db8f825
commit
180d609e0d
@ -190,6 +190,9 @@ namespace
|
|||||||
|
|
||||||
TEST_F(DetourNavigatorNavigatorTest, add_object_should_change_navmesh)
|
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 {{
|
const std::array<float, 5 * 5> heightfieldData {{
|
||||||
0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0,
|
||||||
0, -25, -25, -25, -25,
|
0, -25, -25, -25, -25,
|
||||||
|
@ -256,12 +256,14 @@ namespace DetourNavigator
|
|||||||
|
|
||||||
void AsyncNavMeshUpdater::waitUntilJobsDoneForNotPresentTiles(Loading::Listener& listener)
|
void AsyncNavMeshUpdater::waitUntilJobsDoneForNotPresentTiles(Loading::Listener& listener)
|
||||||
{
|
{
|
||||||
|
const int maxDistanceToPlayer = mSettings.get().mWaitUntilMinDistanceToPlayer;
|
||||||
|
if (maxDistanceToPlayer <= 0)
|
||||||
|
return;
|
||||||
const std::size_t initialJobsLeft = getTotalJobs();
|
const std::size_t initialJobsLeft = getTotalJobs();
|
||||||
std::size_t maxProgress = initialJobsLeft;
|
std::size_t maxProgress = initialJobsLeft;
|
||||||
std::size_t prevJobsLeft = initialJobsLeft;
|
std::size_t prevJobsLeft = initialJobsLeft;
|
||||||
std::size_t jobsDone = 0;
|
std::size_t jobsDone = 0;
|
||||||
std::size_t jobsLeft = 0;
|
std::size_t jobsLeft = 0;
|
||||||
const int maxDistanceToPlayer = mSettings.get().mWaitUntilMinDistanceToPlayer;
|
|
||||||
const TilePosition playerPosition = *mPlayerTile.lockConst();
|
const TilePosition playerPosition = *mPlayerTile.lockConst();
|
||||||
const auto isDone = [&]
|
const auto isDone = [&]
|
||||||
{
|
{
|
||||||
|
@ -154,8 +154,7 @@ namespace DetourNavigator
|
|||||||
|
|
||||||
void NavigatorImpl::wait(Loading::Listener& listener, WaitConditionType waitConditionType)
|
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
|
SharedNavMeshCacheItem NavigatorImpl::getNavMesh(const AgentBounds& agentBounds) const
|
||||||
|
Loading…
Reference in New Issue
Block a user