summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-09-30 16:43:14 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-09-30 18:27:16 +0300
commitc89bfa2ee2d1817af76f586a713d14b4f0e15344 (patch)
tree93c573ff08d0b76810fe9f463f45dca96679cd23 /indra/newview
parent64c055f9be03861661f8c211ae36ba0db489b12d (diff)
Revert "viewer#2363 Region Day Offset error with Time of Day"
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llenvironment.cpp1
-rw-r--r--indra/newview/llpanelenvironment.cpp16
2 files changed, 5 insertions, 12 deletions
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index 722c565300..05bd704556 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -2087,7 +2087,6 @@ void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, S32 track_no, UpdateInf
body[KEY_ENVIRONMENT][KEY_DAYLENGTH] = updates->mDayLength;
}
- // server only allows positive values
if (updates->mDayOffset > 0)
{
body[KEY_ENVIRONMENT][KEY_DAYOFFSET] = updates->mDayOffset;
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp
index 7dd9f6e86e..be61c44b7c 100644
--- a/indra/newview/llpanelenvironment.cpp
+++ b/indra/newview/llpanelenvironment.cpp
@@ -287,8 +287,8 @@ void LLPanelEnvironmentInfo::refresh()
F32Hours daylength(mCurrentEnvironment->mDayLength);
F32Hours dayoffset(mCurrentEnvironment->mDayOffset);
- while (dayoffset.value() >= daylength.value())
- dayoffset -= daylength;
+ if (dayoffset.value() > 12.0f)
+ dayoffset -= F32Hours(24.0);
mSliderDayLength->setValue(daylength.value());
mSliderDayOffset->setValue(dayoffset.value());
@@ -717,11 +717,6 @@ void LLPanelEnvironmentInfo::onSldDayLengthChanged(F32 value)
F32Hours daylength(value);
mCurrentEnvironment->mDayLength = daylength;
- F32 offset = (F32)mSliderDayOffset->getValue().asReal();
- if (offset <= 0.0f)
- {
- onSldDayOffsetChanged(offset);
- }
setDirtyFlag(DIRTY_FLAG_DAYLENGTH);
udpateApparentTimeOfDay();
@@ -734,9 +729,8 @@ void LLPanelEnvironmentInfo::onSldDayOffsetChanged(F32 value)
{
F32Hours dayoffset(value);
- // server only allows positive values
- while (dayoffset.value() <= 0.0f)
- dayoffset += mCurrentEnvironment->mDayLength;
+ if (dayoffset.value() <= 0.0f)
+ dayoffset += F32Hours(24.0);
mCurrentEnvironment->mDayOffset = dayoffset;
setDirtyFlag(DIRTY_FLAG_DAYOFFSET);
@@ -928,7 +922,7 @@ void LLPanelEnvironmentInfo::udpateApparentTimeOfDay()
{
static const F32 SECONDSINDAY(24.0 * 60.0 * 60.0);
- if ((!mCurrentEnvironment) || (mCurrentEnvironment->mDayLength.value() < 1.0))
+ if ((!mCurrentEnvironment) || (mCurrentEnvironment->mDayLength.value() < 1.0) || (mCurrentEnvironment->mDayOffset.value() < 1.0))
{
mLabelApparentTime->setVisible(false);
return;