diff options
Diffstat (limited to 'indra/newview/llfloaterpathfindinglinksets.cpp')
-rw-r--r-- | indra/newview/llfloaterpathfindinglinksets.cpp | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index e24703aca6..2b13d64937 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -383,7 +383,7 @@ PathfindingLinksets::PathfindingLinksets(const LLSD& pNavMeshData) mIsFixedFilter(false),
mIsWalkableFilter(false)
{
- parseNavMeshData(pNavMeshData);
+ setNavMeshData(pNavMeshData);
}
PathfindingLinksets::PathfindingLinksets(const PathfindingLinksets& pOther)
@@ -402,15 +402,15 @@ PathfindingLinksets::~PathfindingLinksets() clearLinksets();
}
-void PathfindingLinksets::parseNavMeshData(const LLSD& pNavMeshData)
+void PathfindingLinksets::setNavMeshData(const LLSD& pNavMeshData)
{
clearLinksets();
- for (LLSD::map_const_iterator linksetIter = pNavMeshData.beginMap();
- linksetIter != pNavMeshData.endMap(); ++linksetIter)
+ for (LLSD::map_const_iterator navMeshDataIter = pNavMeshData.beginMap();
+ navMeshDataIter != pNavMeshData.endMap(); ++navMeshDataIter)
{
- const std::string& uuid(linksetIter->first);
- const LLSD& linksetData = linksetIter->second;
+ const std::string& uuid(navMeshDataIter->first);
+ const LLSD& linksetData = navMeshDataIter->second;
PathfindingLinkset linkset(uuid, linksetData);
mAllLinksets.insert(std::pair<std::string, PathfindingLinkset>(uuid, linkset));
@@ -419,6 +419,29 @@ void PathfindingLinksets::parseNavMeshData(const LLSD& pNavMeshData) mIsFiltersDirty = true;
}
+void PathfindingLinksets::updateNavMeshData(const LLSD& pNavMeshData)
+{
+ for (LLSD::map_const_iterator navMeshDataIter = pNavMeshData.beginMap();
+ navMeshDataIter != pNavMeshData.endMap(); ++navMeshDataIter)
+ {
+ const std::string& uuid(navMeshDataIter->first);
+ const LLSD& linksetData = navMeshDataIter->second;
+ PathfindingLinkset linkset(uuid, linksetData);
+
+ PathfindingLinksetMap::iterator linksetIter = mAllLinksets.find(uuid);
+ if (linksetIter == mAllLinksets.end())
+ {
+ mAllLinksets.insert(std::pair<std::string, PathfindingLinkset>(uuid, linkset));
+ }
+ else
+ {
+ linksetIter->second = linkset;
+ }
+ }
+
+ mIsFiltersDirty = true;
+}
+
void PathfindingLinksets::clearLinksets()
{
mAllLinksets.clear();
@@ -725,7 +748,7 @@ void LLFloaterPathfindingLinksets::sendNavMeshDataPutRequest(const LLSD& pPostDa void LLFloaterPathfindingLinksets::handleNavMeshDataGetReply(const LLSD& pNavMeshData)
{
setFetchState(kFetchReceived);
- mPathfindingLinksets.parseNavMeshData(pNavMeshData);
+ mPathfindingLinksets.setNavMeshData(pNavMeshData);
updateLinksetsList();
setFetchState(kFetchComplete);
}
@@ -741,7 +764,7 @@ void LLFloaterPathfindingLinksets::handleNavMeshDataGetError(const std::string& void LLFloaterPathfindingLinksets::handleNavMeshDataPutReply(const LLSD& pModifiedData)
{
setFetchState(kFetchReceived);
- mPathfindingLinksets.parseNavMeshData(pModifiedData);
+ mPathfindingLinksets.updateNavMeshData(pModifiedData);
updateLinksetsList();
setFetchState(kFetchComplete);
}
|