From df47f35d8fce6eb84ca4b26112e7af506616f4a5 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 10 Apr 2012 11:09:28 -0700 Subject: Altering how the toolset is swapped into and out-of test path mode. --- indra/newview/llfloaterpathfindingconsole.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 7941fd52af..afbf589e5e 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -891,17 +891,21 @@ void LLFloaterPathfindingConsole::setAgentState(LLPathfindingManager::EAgentStat void LLFloaterPathfindingConsole::switchIntoTestPathMode() { llassert(mPathfindingToolset != NULL); - llassert(mSavedToolset == NULL); - mSavedToolset = LLToolMgr::getInstance()->getCurrentToolset(); - LLToolMgr::getInstance()->setCurrentToolset(mPathfindingToolset); + LLToolMgr *toolMgrInstance = LLToolMgr::getInstance(); + if (toolMgrInstance->getCurrentToolset() != mPathfindingToolset) + { + mSavedToolset = toolMgrInstance->getCurrentToolset(); + toolMgrInstance->setCurrentToolset(mPathfindingToolset); + } } void LLFloaterPathfindingConsole::switchOutOfTestPathMode() { llassert(mPathfindingToolset != NULL); - if (mSavedToolset != NULL) + LLToolMgr *toolMgrInstance = LLToolMgr::getInstance(); + if (toolMgrInstance->getCurrentToolset() == mPathfindingToolset) { - LLToolMgr::getInstance()->setCurrentToolset(mSavedToolset); + toolMgrInstance->setCurrentToolset(mSavedToolset); mSavedToolset = NULL; } } -- cgit v1.2.3