diff options
Diffstat (limited to 'indra/newview/llagent.cpp')
| -rw-r--r-- | indra/newview/llagent.cpp | 52 |
1 files changed, 40 insertions, 12 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 085155714a..abea7926ee 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -167,7 +167,7 @@ std::map<S32, std::string> LLTeleportRequest::sTeleportStatusName = { { kPending class LLTeleportRequestViaLandmark : public LLTeleportRequest { public: - LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId); + LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId, bool log = true); virtual ~LLTeleportRequestViaLandmark(); virtual void toOstream(std::ostream& os) const; @@ -179,6 +179,7 @@ public: protected: inline const LLUUID &getLandmarkId() const {return mLandmarkId;}; + bool mLogOnDestruction = true; private: LLUUID mLandmarkId; @@ -385,6 +386,10 @@ LLAgent::LLAgent() : mbRunning(false), mbTeleportKeepsLookAt(false), + mAllowedToStand(true), + mAllowedToSit(true), + mSitObjectID(LLUUID::null), + mAgentAccess(new LLAgentAccess(gSavedSettings)), mGodLevelChangeSignal(), mCanEditParcel(false), @@ -961,7 +966,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() @@ -1281,6 +1290,12 @@ const LLVector3 &LLAgent::getPositionAgent() return mFrameAgent.getOrigin(); } +void LLAgent::setAvatarsPositions(const std::map<LLUUID, LLVector3d>& avatarsPositions) +{ + mAvatarsPositions.clear(); + mAvatarsPositions = avatarsPositions; +} + boost::signals2::connection LLAgent::whenPositionChanged(position_signal_t::slot_type fn) { return mOnPositionChanged.connect(fn); @@ -1324,7 +1339,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); } //----------------------------------------------------------------------------- @@ -5008,16 +5023,25 @@ void LLTeleportRequest::toOstream(std::ostream& os) const //----------------------------------------------------------------------------- // LLTeleportRequestViaLandmark //----------------------------------------------------------------------------- -LLTeleportRequestViaLandmark::LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId) - : LLTeleportRequest(), - mLandmarkId(pLandmarkId) +LLTeleportRequestViaLandmark::LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId, bool log) + : LLTeleportRequest() + , mLandmarkId(pLandmarkId) + , mLogOnDestruction(true) { - LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark created, " << *this << LL_ENDL; + if (log) + { + // Workaround to not log twice for LLTeleportRequestViaLure, besides this wouldn't have logged fully. + LL_INFOS("Teleport") << "LLTeleportRequestViaLandmark created, " << *this << LL_ENDL; + } } LLTeleportRequestViaLandmark::~LLTeleportRequestViaLandmark() { - LL_INFOS("Teleport") << "~LLTeleportRequestViaLandmark, " << *this << LL_ENDL; + if (mLogOnDestruction) + { + // Workaround to not crash on toOstream for derived classes and to not log twice. + LL_INFOS("Teleport") << "~LLTeleportRequestViaLandmark, " << *this << LL_ENDL; + } } void LLTeleportRequestViaLandmark::toOstream(std::ostream& os) const @@ -5047,16 +5071,20 @@ void LLTeleportRequestViaLandmark::restartTeleport() // LLTeleportRequestViaLure //----------------------------------------------------------------------------- -LLTeleportRequestViaLure::LLTeleportRequestViaLure(const LLUUID &pLureId, bool pIsLureGodLike) - : LLTeleportRequestViaLandmark(pLureId), +LLTeleportRequestViaLure::LLTeleportRequestViaLure(const LLUUID& pLureId, bool pIsLureGodLike) + : LLTeleportRequestViaLandmark(pLureId, false), mIsLureGodLike(pIsLureGodLike) { - LL_INFOS("Teleport") << "LLTeleportRequestViaLure created" << LL_ENDL; + LL_INFOS("Teleport") << "LLTeleportRequestViaLure created: " << *this << LL_ENDL; } LLTeleportRequestViaLure::~LLTeleportRequestViaLure() { - LL_INFOS("Teleport") << "~LLTeleportRequestViaLure" << LL_ENDL; + if (mLogOnDestruction) + { + LL_INFOS("Teleport") << "~LLTeleportRequestViaLure: " << *this << LL_ENDL; + mLogOnDestruction = false; + } } void LLTeleportRequestViaLure::toOstream(std::ostream& os) const |
