From d7f372d6bee42f405e0e3772ff8c30f4c1bf6612 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 9 Jul 2012 13:29:50 -0700 Subject: BUGFIX: Correcting a crash issue that was caused by the rebake navmesh callback handler unexpectedly changing the navmesh state. --- indra/newview/llpanelpathfindingrebakenavmesh.cpp | 15 +++++++++------ indra/newview/llpanelpathfindingrebakenavmesh.h | 3 ++- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'indra/newview') 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"); } } diff --git a/indra/newview/llpanelpathfindingrebakenavmesh.h b/indra/newview/llpanelpathfindingrebakenavmesh.h index 5fe581ec2f..48764f2aa7 100644 --- a/indra/newview/llpanelpathfindingrebakenavmesh.h +++ b/indra/newview/llpanelpathfindingrebakenavmesh.h @@ -66,7 +66,8 @@ private: static LLPanelPathfindingRebakeNavmesh* getPanel(); - void setMode(ERebakeNavMeshMode pRebakeNavMeshMode); + void setMode(ERebakeNavMeshMode pRebakeNavMeshMode); + ERebakeNavMeshMode getMode() const; void onNavMeshRebakeClick(); -- cgit v1.2.3