summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermessage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewermessage.cpp')
-rw-r--r--indra/newview/llviewermessage.cpp37
1 files changed, 24 insertions, 13 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 981d226824..e610387b37 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -3760,6 +3760,7 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
void process_time_synch(LLMessageSystem *mesgsys, void **user_data)
{
LLVector3 sun_direction;
+ LLVector3 moon_direction;
LLVector3 sun_ang_velocity;
F32 phase;
U64 space_time_usec;
@@ -3779,14 +3780,26 @@ void process_time_synch(LLMessageSystem *mesgsys, void **user_data)
LLWorld::getInstance()->setSpaceTimeUSec(space_time_usec);
- LL_DEBUGS("WindlightSync") << "Sun phase: " << phase << " rad = " << fmodf(phase / F_TWO_PI + 0.25, 1.f) * 24.f << " h" << LL_ENDL;
+ LL_DEBUGS("ENVIRONMENT") << "Sun phase: " << phase << " rad = " << fmodf(phase / F_TWO_PI + 0.25, 1.f) * 24.f << " h" << LL_ENDL;
- gSky.setSunPhase(phase);
- gSky.setSunTargetDirection(sun_direction, sun_ang_velocity);
- if ( !(gSavedSettings.getBOOL("SkyOverrideSimSunPosition") || gSky.getOverrideSun()) )
- {
- gSky.setSunDirection(sun_direction, sun_ang_velocity);
- }
+ F32 region_phase = LLEnvironment::instance().getRegionProgress();
+ if (region_phase >= 0.0)
+ {
+ F32 adjusted_phase = fmodf(phase / F_TWO_PI + 0.25, 1.f);
+ F32 delta_phase = adjusted_phase - region_phase;
+
+ LL_DEBUGS("ENVIRONMENT") << "adjusted phase = " << adjusted_phase << " local phase = " << region_phase << " delta = " << delta_phase << LL_ENDL;
+
+ if (!LLEnvironment::instance().isExtendedEnvironmentEnabled() && (fabs(delta_phase) > 0.125))
+ {
+ LL_INFOS("ENVIRONMENT") << "Adjusting environment to match region. adjustment=" << delta_phase << LL_ENDL;
+ LLEnvironment::instance().adjustRegionOffset(delta_phase);
+ }
+ }
+
+ /* We decode these parts of the message but ignore them
+ as the real values are provided elsewhere. */
+ (void)sun_direction, (void)moon_direction, (void)phase;
}
void process_sound_trigger(LLMessageSystem *msg, void **)
@@ -5763,18 +5776,16 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
// check whether permission question should cause special caution dialog
caution |= (script_perm.caution);
- if (("ScriptTakeMoney" == script_perm.question) && has_not_only_debit)
+ if ((("ScriptTakeMoney" == script_perm.question) && has_not_only_debit) ||
+ (script_perm.question == "JoinAnExperience"))
continue;
- if (script_perm.question == "JoinAnExperience")
- { // Some experience only permissions do not have an explicit permission bit. Add them here.
- script_question += " " + LLTrans::getString("ForceSitAvatar") + "\n";
- }
-
script_question += " " + LLTrans::getString(script_perm.question) + "\n";
}
}
+ script_question += "\n";
+
args["QUESTIONS"] = script_question;
if (known_questions != questions)