From 4d0b9805843b4b09411825b5ad8989fcdfc9595b Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 17 Jun 2024 22:50:50 +0300 Subject: viewer#1772 Teleport History landing going higher and higher --- indra/newview/llteleporthistorystorage.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp index fa4e92e209..6a7ebaf8d6 100644 --- a/indra/newview/llteleporthistorystorage.cpp +++ b/indra/newview/llteleporthistorystorage.cpp @@ -127,6 +127,12 @@ void LLTeleportHistoryStorage::addItem(const std::string title, const LLVector3d S32 removed_index = -1; if (item_iter != mItems.end()) { + // When teleporting via history it's possible that there can be + // an offset applied to the position, so each new teleport can + // be a meter higher than the last. + // Avoid it by preserving original position. + item.mGlobalPos = item_iter->mGlobalPos; + removed_index = item_iter - mItems.begin(); mItems.erase(item_iter); } -- cgit v1.2.3