summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelpathfindingrebakenavmesh.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelpathfindingrebakenavmesh.cpp')
-rw-r--r--indra/newview/llpanelpathfindingrebakenavmesh.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/indra/newview/llpanelpathfindingrebakenavmesh.cpp b/indra/newview/llpanelpathfindingrebakenavmesh.cpp
index 2c8c46c7bc..8df041f578 100644
--- a/indra/newview/llpanelpathfindingrebakenavmesh.cpp
+++ b/indra/newview/llpanelpathfindingrebakenavmesh.cpp
@@ -159,6 +159,11 @@ void LLPanelPathfindingRebakeNavmesh::setMode(ERebakeNavMeshMode pRebakeNavMeshM
mRebakeNavMeshMode = pRebakeNavMeshMode;
}
+LLPanelPathfindingRebakeNavmesh::ERebakeNavMeshMode LLPanelPathfindingRebakeNavmesh::getMode() const
+{
+ return mRebakeNavMeshMode;
+}
+
void LLPanelPathfindingRebakeNavmesh::onNavMeshRebakeClick()
{
setMode(kRebakeNavMesh_RequestSent);
@@ -172,16 +177,14 @@ void LLPanelPathfindingRebakeNavmesh::handleAgentState(BOOL pCanRebakeRegion)
void LLPanelPathfindingRebakeNavmesh::handleRebakeNavMeshResponse(bool pResponseStatus)
{
- setMode(pResponseStatus ? kRebakeNavMesh_InProgress : kRebakeNavMesh_Default);
- if (!pResponseStatus)
+ if (getMode() == kRebakeNavMesh_RequestSent)
{
- LLNotificationsUtil::add("PathfindingCannotRebakeNavmesh");
+ setMode(pResponseStatus ? kRebakeNavMesh_InProgress : kRebakeNavMesh_Default);
}
- LLViewerRegion *currentRegion = gAgent.getRegion();
- if (currentRegion != NULL)
+ if (!pResponseStatus)
{
- LLPathfindingManager::getInstance()->requestGetNavMeshForRegion(currentRegion, true);
+ LLNotificationsUtil::add("PathfindingCannotRebakeNavmesh");
}
}