diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 267967ebe..2e7143ad5 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -296,15 +296,25 @@ std::size_t hash_value(const LLUUID& uuid) return (std::size_t)uuid.getCRC32(); } boost::unordered_map mm_MarkerColors; -bool mm_getMarkerColor(const LLUUID& id, LLColor4& color) +const LLColor4* mm_getMarkerColor(const LLUUID& id) { - boost::unordered_map::const_iterator it = mm_MarkerColors.find(id); - if (it == mm_MarkerColors.end()) return false; - color = it->second; - return true; + auto it = mm_MarkerColors.find(id); + return it == mm_MarkerColors.end() ? nullptr : &it->second; } -void LLNetMap::mm_setcolor(LLUUID key,LLColor4 col) +bool mm_getMarkerColor(const LLUUID& id, LLColor4& color) +{ + auto c = mm_getMarkerColor(id); + if (c) color = *c; + return c; +} + +void mm_clearMark(const LLUUID& id) +{ + mm_MarkerColors.erase(id); +} + +void mm_setcolor(LLUUID key,LLColor4 col) { mm_MarkerColors[key] = col; } @@ -1499,7 +1509,7 @@ bool LLScaleMap::handleEvent(LLPointer event, const LLSD& userdata) void markMassAgents(const LLColor4& color) { for (const auto& id : LFIDBearer::getActiveSelectedIDs()) - LLNetMap::mm_setcolor(id, color); + mm_setcolor(id, color); } bool mmsetred::handleEvent(LLPointer, const LLSD&) @@ -1530,7 +1540,7 @@ bool mmsetcustom::handleEvent(LLPointer, const LLSD&) bool mmsetunmark::handleEvent(LLPointer, const LLSD&) { for (const auto& id : LFIDBearer::getActiveSelectedIDs()) - mm_MarkerColors.erase(id); + mm_clearMark(id); return true; } bool mmenableunmark::handleEvent(LLPointer, const LLSD& userdata) diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index 47c32438b..75200dfb9 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -72,9 +72,6 @@ public: uuid_vec_t getSelectedIDs() const override final { return mClosestAgentsAtLastClick; } S32 getNumSelected() const override final { return mClosestAgentsAtLastClick.size(); } - static void mm_setcolor(LLUUID key,LLColor4 col); //moymod - - // [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3.0) void refreshParcelOverlay() { mUpdateParcelImage = true; } // [/SL:KB] @@ -157,7 +154,7 @@ private: LLUUID mClosestAgentToCursor; LLUUID mClosestAgentAtLastRightClick; - BOOL isAgentUnderCursor() { return mClosestAgentToCursor.notNull(); } + BOOL isAgentUnderCursor() const { return mClosestAgentToCursor.notNull(); } LLMenuGL* mPopupMenu; };