diff options
author | William Todd Stinson <stinson@lindenlab.com> | 2012-12-18 11:00:13 -0800 |
---|---|---|
committer | William Todd Stinson <stinson@lindenlab.com> | 2012-12-18 11:00:13 -0800 |
commit | 3feacc96c6cf87f1be034312d8c71d21bae88351 (patch) | |
tree | 9383df67646e763e5d3cf11daf413720ea0b8e9e | |
parent | 4745afe679b0b835d602b22ea0df1b7e918888ac (diff) | |
parent | 00d6b1913430058add7d593bd6be790702f37ea4 (diff) |
Pull and merge from https://bitbucket.org/lindenlab/viewer-development.
-rwxr-xr-x | .hgtags | 1 | ||||
-rw-r--r-- | indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp | 82 |
2 files changed, 45 insertions, 38 deletions
@@ -385,3 +385,4 @@ daca610d840625b5bebb966a57cb49581852c417 DRTVWR-265 0a2ca6546b499239afeb66d17b2fadbcdbe36ab1 3.4.3-release 84fbaf2d4141bd161731430e760949dc787ca206 DRTVWR-244 083d2d36b5bb1c54fc3dd7caac0e7ac381a9cef0 3.4.4-beta1 +391a8c74cec7275c5d26c85ad108d4782a3e3dd9 DRTVWR-268 diff --git a/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp b/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp index dd5f1ea689..bf4f4bceed 100644 --- a/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp +++ b/indra/newview/llmenuoptionpathfindingrebakenavmesh.cpp @@ -54,23 +54,21 @@ LLMenuOptionPathfindingRebakeNavmesh::LLMenuOptionPathfindingRebakeNavmesh() LLMenuOptionPathfindingRebakeNavmesh::~LLMenuOptionPathfindingRebakeNavmesh() { - if (mRebakeNavMeshMode == kRebakeNavMesh_RequestSent) - { - LL_WARNS("navmeshRebaking") << "During destruction of the LLMenuOptionPathfindingRebakeNavmesh " - << "singleton, the mode indicates that a request has been sent for which a response has yet " - << "to be received. This could contribute to a crash on exit." << LL_ENDL; - } - - llassert(!mIsInitialized); if (mIsInitialized) { + if (mRebakeNavMeshMode == kRebakeNavMesh_RequestSent) + { + LL_WARNS("navmeshRebaking") << "During destruction of the LLMenuOptionPathfindingRebakeNavmesh " + << "singleton, the mode indicates that a request has been sent for which a response has yet " + << "to be received. This could contribute to a crash on exit." << LL_ENDL; + } + quit(); } } void LLMenuOptionPathfindingRebakeNavmesh::initialize() { - llassert(!mIsInitialized); if (!mIsInitialized) { mIsInitialized = true; @@ -94,7 +92,6 @@ void LLMenuOptionPathfindingRebakeNavmesh::initialize() void LLMenuOptionPathfindingRebakeNavmesh::quit() { - llassert(mIsInitialized); if (mIsInitialized) { if (mNavMeshSlot.connected()) @@ -175,51 +172,60 @@ void LLMenuOptionPathfindingRebakeNavmesh::handleAgentState(BOOL pCanRebakeRegio void LLMenuOptionPathfindingRebakeNavmesh::handleRebakeNavMeshResponse(bool pResponseStatus) { llassert(mIsInitialized); - if (getMode() == kRebakeNavMesh_RequestSent) + if (mIsInitialized) { - setMode(pResponseStatus ? kRebakeNavMesh_InProgress : kRebakeNavMesh_Default); - } + if (getMode() == kRebakeNavMesh_RequestSent) + { + setMode(pResponseStatus ? kRebakeNavMesh_InProgress : kRebakeNavMesh_Default); + } - if (!pResponseStatus) - { - LLNotificationsUtil::add("PathfindingCannotRebakeNavmesh"); + if (!pResponseStatus) + { + LLNotificationsUtil::add("PathfindingCannotRebakeNavmesh"); + } } } void LLMenuOptionPathfindingRebakeNavmesh::handleNavMeshStatus(const LLPathfindingNavMeshStatus &pNavMeshStatus) { llassert(mIsInitialized); - ERebakeNavMeshMode rebakeNavMeshMode = kRebakeNavMesh_Default; - if (pNavMeshStatus.isValid()) + if (mIsInitialized) { - switch (pNavMeshStatus.getStatus()) + ERebakeNavMeshMode rebakeNavMeshMode = kRebakeNavMesh_Default; + if (pNavMeshStatus.isValid()) { - case LLPathfindingNavMeshStatus::kPending : - case LLPathfindingNavMeshStatus::kRepending : - rebakeNavMeshMode = kRebakeNavMesh_Available; - break; - case LLPathfindingNavMeshStatus::kBuilding : - rebakeNavMeshMode = kRebakeNavMesh_InProgress; - break; - case LLPathfindingNavMeshStatus::kComplete : - rebakeNavMeshMode = kRebakeNavMesh_NotAvailable; - break; - default : - rebakeNavMeshMode = kRebakeNavMesh_Default; - llassert(0); - break; + switch (pNavMeshStatus.getStatus()) + { + case LLPathfindingNavMeshStatus::kPending : + case LLPathfindingNavMeshStatus::kRepending : + rebakeNavMeshMode = kRebakeNavMesh_Available; + break; + case LLPathfindingNavMeshStatus::kBuilding : + rebakeNavMeshMode = kRebakeNavMesh_InProgress; + break; + case LLPathfindingNavMeshStatus::kComplete : + rebakeNavMeshMode = kRebakeNavMesh_NotAvailable; + break; + default : + rebakeNavMeshMode = kRebakeNavMesh_Default; + llassert(0); + break; + } } - } - setMode(rebakeNavMeshMode); + setMode(rebakeNavMeshMode); + } } void LLMenuOptionPathfindingRebakeNavmesh::handleRegionBoundaryCrossed() { llassert(mIsInitialized); - createNavMeshStatusListenerForCurrentRegion(); - mCanRebakeRegion = FALSE; - LLPathfindingManager::getInstance()->requestGetAgentState(); + if (mIsInitialized) + { + createNavMeshStatusListenerForCurrentRegion(); + mCanRebakeRegion = FALSE; + LLPathfindingManager::getInstance()->requestGetAgentState(); + } } void LLMenuOptionPathfindingRebakeNavmesh::createNavMeshStatusListenerForCurrentRegion() |