summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfloaterpathfindingconsole.cpp14
1 files changed, 9 insertions, 5 deletions
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;
}
}