diff options
Diffstat (limited to 'indra/newview/llagent.cpp')
-rw-r--r-- | indra/newview/llagent.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index dde4555770..f7b48d25f2 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -386,6 +386,10 @@ LLAgent::LLAgent() : mbRunning(false), mbTeleportKeepsLookAt(false), + mAllowedToStand(true), + mAllowedToSit(true), + mSitObjectID(LLUUID::null), + mAgentAccess(new LLAgentAccess(gSavedSettings)), mGodLevelChangeSignal(), mCanEditParcel(false), @@ -969,7 +973,11 @@ bool LLAgent::isSitting() void LLAgent::standUp() { - setControlFlags(AGENT_CONTROL_STAND_UP); + if (mAllowedToStand) + { + setControlFlags(AGENT_CONTROL_STAND_UP); + mSitObjectID = LLUUID::null; + } } void LLAgent::changeParcels() @@ -1343,7 +1351,7 @@ LLVector3d LLAgent::getPosGlobalFromAgent(const LLVector3 &pos_agent) const void LLAgent::sitDown() { - setControlFlags(AGENT_CONTROL_SIT_ON_GROUND); + if (mAllowedToSit) setControlFlags(AGENT_CONTROL_SIT_ON_GROUND); } @@ -2502,7 +2510,10 @@ void LLAgent::endAnimationUpdateUI() gAgentAvatarp->updateAttachmentVisibility(gAgentCamera.getCameraMode()); } - gFloaterTools->dirty(); + if (gFloaterTools) + { + gFloaterTools->dirty(); + } // Don't let this be called more than once if the camera // mode hasn't changed. --JC @@ -4318,9 +4329,14 @@ void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id) void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id) { - bool is_local(false); - LLViewerRegion* regionp = getRegion(); + LLViewerRegion* regionp = getRegion(); + if (!regionp) + { + LL_WARNS("Teleport") << "called when agent region is null" << LL_ENDL; + return; + } + bool is_local(false); if (LLLandmark* landmark = gLandmarkList.getAsset(landmark_asset_id, NULL)) { LLVector3d pos_global; |