From 1d8f70652393f191f4dbb455cef739d92822d666 Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Fri, 13 Jul 2018 22:20:25 +0200 Subject: [PATCH] FIRE-21622: Rework Flight Assist to work with llSetForce() instead of llApplyImpulse() --- .../app_settings/settings_per_account.xml | 2 +- ...BEDD1D2-A320-43f5-88CF-DD47BBCA5DFB.lsltxt | 27 +++++++------------ indra/newview/fslslbridge.cpp | 2 +- .../xui/en/panel_preferences_firestorm.xml | 8 ++++-- .../xui/pl/panel_preferences_firestorm.xml | 1 + 5 files changed, 19 insertions(+), 21 deletions(-) diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index f8f86b28ab..df36dfc407 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -900,7 +900,7 @@ UseLSLFlightAssist Comment - Use the client LSL bridge for flight boost - boost power: 0.0 (disabled), 5.0 (low), 10.0 (moderate), 15.0 (high). + Use the client LSL bridge for flight boost - boost power: 0.0 (disabled), 0.5 (mild), 1.0 (moderate), 2.0 (high), 15.0 (extreme). Persist 1 Type diff --git a/indra/newview/fs_resources/EBEDD1D2-A320-43f5-88CF-DD47BBCA5DFB.lsltxt b/indra/newview/fs_resources/EBEDD1D2-A320-43f5-88CF-DD47BBCA5DFB.lsltxt index f01f9f3e14..5ae40f4dfd 100644 --- a/indra/newview/fs_resources/EBEDD1D2-A320-43f5-88CF-DD47BBCA5DFB.lsltxt +++ b/indra/newview/fs_resources/EBEDD1D2-A320-43f5-88CF-DD47BBCA5DFB.lsltxt @@ -7,7 +7,7 @@ // // Bridge platform - string BRIDGE_VERSION = "2.22"; // This should match fslslbridge.cpp + string BRIDGE_VERSION = "2.23"; // This should match fslslbridge.cpp string gLatestURL; integer gViewerIsFirestorm; integer gTryHandshakeOnce = TRUE; @@ -27,10 +27,9 @@ // Flight assist integer gIsFlyingNow; - float FLIGHT_CHECK_NORMAL = 0.2; + float FLIGHT_CHECK_NORMAL = 0.5; float FLIGHT_CHECK_SLOW = 3.0; float gFlightAssistPushForce; - float gFlightAssistMinAltitude = 10; // OpenCollar/LockMeister AO interface integer gAO_EnabledOC; @@ -131,11 +130,11 @@ { if (yes) { - llSetForce((<0.0, 0.0, 9.8> * llGetMass()), 0); + llSetForce((<0.0, 0.0, 9.8> * llGetMass()), 1); } else { - llSetForce(ZERO_VECTOR, 0); + llSetForce(ZERO_VECTOR, 1); } } @@ -255,16 +254,7 @@ default if (gFlightAssistPushForce > 0 && gIsFlyingNow) { - - vector currentPosition = llGetPos(); - float currentGroundLevel = llGround(ZERO_VECTOR); - float currentWaterLevel = llWater(ZERO_VECTOR); - if (currentGroundLevel < currentWaterLevel) - { - currentGroundLevel = currentWaterLevel; - } - - if (currentPosition.z > currentGroundLevel + gFlightAssistMinAltitude && level & (CONTROL_FWD | CONTROL_BACK | CONTROL_LEFT | CONTROL_RIGHT | CONTROL_UP | CONTROL_DOWN)) + if (level & edge & (CONTROL_FWD | CONTROL_BACK | CONTROL_LEFT | CONTROL_RIGHT | CONTROL_UP | CONTROL_DOWN)) { vector pushingForce = ZERO_VECTOR; // Forward / back @@ -294,9 +284,12 @@ default { pushingForce += <0, 0, -gFlightAssistPushForce>; } - llApplyImpulse(llGetMassMKS() * pushingForce, 1); + llSetForce(llGetMassMKS() * pushingForce, 1); + } + else if (~level & edge & (CONTROL_FWD | CONTROL_BACK | CONTROL_LEFT | CONTROL_RIGHT | CONTROL_UP | CONTROL_DOWN)) + { + flightHover(TRUE); } - } } diff --git a/indra/newview/fslslbridge.cpp b/indra/newview/fslslbridge.cpp index f058d04c51..11693de12f 100644 --- a/indra/newview/fslslbridge.cpp +++ b/indra/newview/fslslbridge.cpp @@ -52,7 +52,7 @@ static const std::string FS_BRIDGE_FOLDER = "#LSL Bridge"; static const std::string FS_BRIDGE_CONTAINER_FOLDER = "Landscaping"; static const U32 FS_BRIDGE_MAJOR_VERSION = 2; -static const U32 FS_BRIDGE_MINOR_VERSION = 22; +static const U32 FS_BRIDGE_MINOR_VERSION = 23; static const U32 FS_MAX_MINOR_VERSION = 99; static const std::string UPLOAD_SCRIPT_CURRENT = "EBEDD1D2-A320-43f5-88CF-DD47BBCA5DFB.lsltxt"; static const std::string FS_STATE_ATTRIBUTE = "state="; diff --git a/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml b/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml index cb028c4c97..045fa5727a 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_firestorm.xml @@ -168,14 +168,18 @@ + value="0.5" /> + value="1.0" /> + diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_firestorm.xml b/indra/newview/skins/default/xui/pl/panel_preferences_firestorm.xml index 799f0a67fa..a28fb5b0f2 100644 --- a/indra/newview/skins/default/xui/pl/panel_preferences_firestorm.xml +++ b/indra/newview/skins/default/xui/pl/panel_preferences_firestorm.xml @@ -31,6 +31,7 @@ +