Fix Release Blocker: Swimming is on by default incorrectly initially

This commit is contained in:
Lirusaito
2019-03-02 13:19:11 -05:00
parent 0a80dd0d87
commit 1b5b11907e

View File

@@ -36,7 +36,8 @@ void cmdline_printchat(const std::string& message);
namespace
{
bool sSwimming = false;
bool is_underwater() { return gAgentAvatarp && gAgentAvatarp->mBelowWater; }
const LLCachedControl<bool> sSwim(gSavedSettings, "AOSwimEnabled", false);
bool is_underwater() { return sSwim && gAgentAvatarp && gAgentAvatarp->mBelowWater; }
}
class AONotecardCallback : public LLInventoryCallback
@@ -643,9 +644,8 @@ void LLFloaterAO::ChangeStand()
void LLFloaterAO::toggleSwim(bool underwater)
{
const LLCachedControl<bool> enabled(gSavedSettings, "AOEnabled", false);
const LLCachedControl<bool> swim(gSavedSettings, "AOSwimEnabled", false);
sSwimming = underwater && swim;
sSwimming = underwater && sSwim;
// Don't send requests if we have the AO disabled.
if (enabled)