summaryrefslogtreecommitdiff
path: root/indra/newview/llteleporthistorystorage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llteleporthistorystorage.cpp')
-rw-r--r--indra/newview/llteleporthistorystorage.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp
index 8a5704939a..93fa457bd0 100644
--- a/indra/newview/llteleporthistorystorage.cpp
+++ b/indra/newview/llteleporthistorystorage.cpp
@@ -33,6 +33,8 @@
#include "lldir.h"
#include "llteleporthistory.h"
#include "llagent.h"
+#include "llfloaterreg.h"
+#include "llfloaterworldmap.h"
// Max offset for two global positions to consider them as equal
const F64 MAX_GLOBAL_POS_OFFSET = 5.0f;
@@ -253,3 +255,23 @@ void LLTeleportHistoryStorage::goToItem(S32 idx)
gAgent.teleportViaLocation(mItems[idx].mGlobalPos);
}
+void LLTeleportHistoryStorage::showItemOnMap(S32 idx)
+{
+ // Validate specified index.
+ if (idx < 0 || idx >= (S32)mItems.size())
+ {
+ LL_WARNS() << "Invalid teleport history index (" << idx << ") specified" << LL_ENDL;
+ dump();
+ return;
+ }
+
+ LLVector3d landmark_global_pos = mItems[idx].mGlobalPos;
+
+ LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance();
+ if (!landmark_global_pos.isExactlyZero() && worldmap_instance)
+ {
+ worldmap_instance->trackLocation(landmark_global_pos);
+ LLFloaterReg::showInstance("world_map", "center");
+ }
+}
+