diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index a30d7bfcb..09fba4c59 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -1032,6 +1032,17 @@ Changing this setting only affects new text. Value 3.5 + EmergencyTeleportSeconds + + Comment + The remaining time left in seconds when to execute an emergency teleport out of a restarting region. + Persist + 1 + Type + U32 + Value + 20 + LiruFlashWhenMinimized Comment diff --git a/indra/newview/llfloaterregionrestarting.cpp b/indra/newview/llfloaterregionrestarting.cpp index 448b85216..26e0da4d6 100644 --- a/indra/newview/llfloaterregionrestarting.cpp +++ b/indra/newview/llfloaterregionrestarting.cpp @@ -39,8 +39,11 @@ #include "lllandmarklist.h" #include "llviewerregion.h" #include "llworldmap.h" -void emergency_teleport() +void emergency_teleport(const U32& seconds) { + static const LLCachedControl time(gSavedSettings, "EmergencyTeleportSeconds"); + if (seconds > time) return; + static const LLCachedControl landmark(gSavedPerAccountSettings, "EmergencyTeleportLandmark"); if (landmark().empty()) return; LLUUID id(landmark); @@ -120,7 +123,7 @@ LLFloaterRegionRestarting::~LLFloaterRegionRestarting() BOOL LLFloaterRegionRestarting::postBuild() { mRegionChangedConnection = gAgent.addRegionChangedCallback(boost::bind(&LLFloaterRegionRestarting::regionChange, this)); - if (mSeconds <= 20) emergency_teleport(); // For emergency teleports + emergency_teleport(mSeconds); // For emergency teleports LLStringUtil::format_map_t args; std::string text; @@ -158,7 +161,7 @@ void LLFloaterRegionRestarting::refresh() args["[SECONDS]"] = llformat("%d", mSeconds); mRestartSeconds->setValue(getString("RestartSeconds", args)); - if (mSeconds == 20) emergency_teleport(); // For emergency teleports + emergency_teleport(mSeconds); // For emergency teleports if (!mSeconds) return; // Zero means we're done. --mSeconds; } @@ -233,6 +236,6 @@ void LLFloaterRegionRestarting::draw() void LLFloaterRegionRestarting::updateTime(const U32& time) { mSeconds = time; - if (mSeconds <= 20) emergency_teleport(); // For emergency teleports + emergency_teleport(mSeconds); // For emergency teleports sShakeState = SHAKE_START; }