aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llagent.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llagent.cpp37
1 files changed, 31 insertions, 6 deletions
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp
index 42fc27d..8b49d54 100644
--- a/linden/indra/newview/llagent.cpp
+++ b/linden/indra/newview/llagent.cpp
@@ -903,6 +903,7 @@ BOOL LLAgent::canManageEstate() const
903{ 903{
904 return mRegionp && mRegionp->canManageEstate(); 904 return mRegionp && mRegionp->canManageEstate();
905} 905}
906
906//----------------------------------------------------------------------------- 907//-----------------------------------------------------------------------------
907// sendMessage() 908// sendMessage()
908//----------------------------------------------------------------------------- 909//-----------------------------------------------------------------------------
@@ -2934,6 +2935,7 @@ void LLAgent::endAnimationUpdateUI()
2934 // Don't let this be called more than once if the camera 2935 // Don't let this be called more than once if the camera
2935 // mode hasn't changed. --JC 2936 // mode hasn't changed. --JC
2936 mLastCameraMode = mCameraMode; 2937 mLastCameraMode = mCameraMode;
2938
2937} 2939}
2938 2940
2939 2941
@@ -4194,15 +4196,22 @@ void LLAgent::changeCameraToCustomizeAvatar(BOOL animate)
4194 if (animate && !mAvatarObject.isNull()) 4196 if (animate && !mAvatarObject.isNull())
4195 { 4197 {
4196 sendAnimationRequest(ANIM_AGENT_CUSTOMIZE, ANIM_REQUEST_START); 4198 sendAnimationRequest(ANIM_AGENT_CUSTOMIZE, ANIM_REQUEST_START);
4199 mAvatarObject->startMotion(ANIM_AGENT_CUSTOMIZE);
4197 LLMotion* turn_motion = mAvatarObject->findMotion(ANIM_AGENT_CUSTOMIZE); 4200 LLMotion* turn_motion = mAvatarObject->findMotion(ANIM_AGENT_CUSTOMIZE);
4201
4198 if (turn_motion) 4202 if (turn_motion)
4199 { 4203 {
4200 mAnimationDuration = turn_motion->getDuration() + CUSTOMIZE_AVATAR_CAMERA_ANIM_SLOP; 4204 mAnimationDuration = turn_motion->getDuration() + CUSTOMIZE_AVATAR_CAMERA_ANIM_SLOP;
4205
4201 } 4206 }
4202 else 4207 else
4203 { 4208 {
4204 mAnimationDuration = gSavedSettings.getF32("ZoomTime"); 4209 mAnimationDuration = gSavedSettings.getF32("ZoomTime");
4205 } 4210 }
4211
4212
4213
4214
4206 gAgent.setFocusGlobal(LLVector3d::zero); 4215 gAgent.setFocusGlobal(LLVector3d::zero);
4207 } 4216 }
4208 else 4217 else
@@ -4709,6 +4718,22 @@ U8 LLAgent::getGodLevel() const
4709#endif 4718#endif
4710} 4719}
4711 4720
4721bool LLAgent::isTeen() const
4722{
4723 return mAccess < SIM_ACCESS_MATURE;
4724}
4725
4726void LLAgent::setTeen(bool teen)
4727{
4728 if (teen)
4729 {
4730 mAccess = SIM_ACCESS_PG;
4731 }
4732 else
4733 {
4734 mAccess = SIM_ACCESS_MATURE;
4735 }
4736}
4712 4737
4713void LLAgent::buildFullname(std::string& name) const 4738void LLAgent::buildFullname(std::string& name) const
4714{ 4739{
@@ -5627,7 +5652,7 @@ void LLAgent::teleportRequest(
5627} 5652}
5628 5653
5629// Landmark ID = LLUUID::null means teleport home 5654// Landmark ID = LLUUID::null means teleport home
5630void LLAgent::teleportViaLandmark(const LLUUID& landmark_id) 5655void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id)
5631{ 5656{
5632 LLViewerRegion *regionp = getRegion(); 5657 LLViewerRegion *regionp = getRegion();
5633 if(regionp && teleportCore()) 5658 if(regionp && teleportCore())
@@ -5637,7 +5662,7 @@ void LLAgent::teleportViaLandmark(const LLUUID& landmark_id)
5637 msg->nextBlockFast(_PREHASH_Info); 5662 msg->nextBlockFast(_PREHASH_Info);
5638 msg->addUUIDFast(_PREHASH_AgentID, getID()); 5663 msg->addUUIDFast(_PREHASH_AgentID, getID());
5639 msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); 5664 msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
5640 msg->addUUIDFast(_PREHASH_LandmarkID, landmark_id); 5665 msg->addUUIDFast(_PREHASH_LandmarkID, landmark_asset_id);
5641 sendReliableMessage(); 5666 sendReliableMessage();
5642 } 5667 }
5643} 5668}
@@ -6850,7 +6875,7 @@ void LLAgent::removeWearable( EWearableType type )
6850{ 6875{
6851 LLWearable* old_wearable = mWearableEntry[ type ].mWearable; 6876 LLWearable* old_wearable = mWearableEntry[ type ].mWearable;
6852 6877
6853 if ( (gAgent.mAccess < SIM_ACCESS_MATURE) 6878 if ( (gAgent.isTeen())
6854 && (type == WT_UNDERSHIRT || type == WT_UNDERPANTS)) 6879 && (type == WT_UNDERSHIRT || type == WT_UNDERPANTS))
6855 { 6880 {
6856 // Can't take off underclothing in simple UI mode or on PG accounts 6881 // Can't take off underclothing in simple UI mode or on PG accounts
@@ -6985,8 +7010,8 @@ void LLAgent::setWearableOutfit(
6985 wearables_to_remove[WT_SOCKS] = remove; 7010 wearables_to_remove[WT_SOCKS] = remove;
6986 wearables_to_remove[WT_JACKET] = remove; 7011 wearables_to_remove[WT_JACKET] = remove;
6987 wearables_to_remove[WT_GLOVES] = remove; 7012 wearables_to_remove[WT_GLOVES] = remove;
6988 wearables_to_remove[WT_UNDERSHIRT] = (gAgent.mAccess >= SIM_ACCESS_MATURE) & remove; 7013 wearables_to_remove[WT_UNDERSHIRT] = (!gAgent.isTeen()) & remove;
6989 wearables_to_remove[WT_UNDERPANTS] = (gAgent.mAccess >= SIM_ACCESS_MATURE) & remove; 7014 wearables_to_remove[WT_UNDERPANTS] = (!gAgent.isTeen()) & remove;
6990 wearables_to_remove[WT_SKIRT] = remove; 7015 wearables_to_remove[WT_SKIRT] = remove;
6991 7016
6992 S32 count = wearables.count(); 7017 S32 count = wearables.count();
@@ -7224,7 +7249,7 @@ void LLAgent::userRemoveWearable( void* userdata )
7224 EWearableType type = (EWearableType)(intptr_t)userdata; 7249 EWearableType type = (EWearableType)(intptr_t)userdata;
7225 7250
7226 if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR ) ) //&& 7251 if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR ) ) //&&
7227 //!((gAgent.mAccess >= SIM_ACCESS_MATURE) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) ) 7252 //!((!gAgent.isTeen()) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) )
7228 { 7253 {
7229 gAgent.removeWearable( type ); 7254 gAgent.removeWearable( type );
7230 } 7255 }