diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-10-26 18:27:08 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2012-10-26 18:27:08 -0400 |
commit | 3aeff074cfc2f14b661b96bc0664087a95a99eff (patch) | |
tree | 4e36fc435812894b5854fac3252149518eff5e34 /indra/newview/llagent.cpp | |
parent | 6c62c4e716753456b7de47652a575fafdba45049 (diff) |
SH-3469 FIX - use callback mechanism to handle possible race between getting caps and setting agent region
Diffstat (limited to 'indra/newview/llagent.cpp')
-rwxr-xr-x | indra/newview/llagent.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 9eb2723dcf..c49caf93be 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -809,6 +809,18 @@ void LLAgent::standUp() } +void LLAgent::handleServerBakeRegionTransition(const LLUUID& region_id) +{ + llinfos << "called" << llendl; + + if (isAgentAvatarValid() && + !gAgentAvatarp->isUsingServerBakes() && + (mRegionp->getCentralBakeVersion()>0)) + { + LLAppearanceMgr::instance().requestServerAppearanceUpdate(); + } +} + //----------------------------------------------------------------------------- // setRegion() //----------------------------------------------------------------------------- @@ -908,11 +920,14 @@ void LLAgent::setRegion(LLViewerRegion *regionp) // If the newly entered region is using server bakes, and our // current appearance is non-baked, request appearance update from // server. - if (isAgentAvatarValid() && - !gAgentAvatarp->isUsingServerBakes() && - (mRegionp->getCentralBakeVersion()>0)) + if (mRegionp->capabilitiesReceived()) { - LLAppearanceMgr::instance().requestServerAppearanceUpdate(); + handleServerBakeRegionTransition(mRegionp->getRegionID()); + } + else + { + // Need to handle via callback after caps arrive. + mRegionp->setCapabilitiesReceivedCallback(boost::bind(&LLAgent::handleServerBakeRegionTransition,this,_1)); } } |