diff options
author | Armin Weatherwax | 2010-02-26 17:33:44 +0100 |
---|---|---|
committer | Jacek Antonelli | 2010-03-04 21:34:08 -0600 |
commit | cedce34ead32b5b6b595c133b94bbbede0324f6b (patch) | |
tree | 46e1366257c8480081d93fa10fe69ba95c938bca | |
parent | Ported temporary texture uploads from Emerald. (diff) | |
download | meta-impy-cedce34ead32b5b6b595c133b94bbbede0324f6b.zip meta-impy-cedce34ead32b5b6b595c133b94bbbede0324f6b.tar.gz meta-impy-cedce34ead32b5b6b595c133b94bbbede0324f6b.tar.bz2 meta-impy-cedce34ead32b5b6b595c133b94bbbede0324f6b.tar.xz |
Added PrivateLookAtTarget option.
When true, viewer won't tell where your avatar is looking.
-rw-r--r-- | linden/indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | linden/indra/newview/llhudeffectlookat.cpp | 24 |
2 files changed, 32 insertions, 3 deletions
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 93dc2fb..1cf31d7 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -7136,6 +7136,17 @@ | |||
7136 | <integer>0</integer> | 7136 | <integer>0</integer> |
7137 | </array> | 7137 | </array> |
7138 | </map> | 7138 | </map> |
7139 | <key>PrivateLookAtTarget</key> | ||
7140 | <map> | ||
7141 | <key>Comment</key> | ||
7142 | <string>If true, viewer won't tell other viewers where your avatar is looking.</string> | ||
7143 | <key>Persist</key> | ||
7144 | <integer>1</integer> | ||
7145 | <key>Type</key> | ||
7146 | <string>Boolean</string> | ||
7147 | <key>Value</key> | ||
7148 | <integer>0</integer> | ||
7149 | </map> | ||
7139 | <key>ProbeHardwareOnStartup</key> | 7150 | <key>ProbeHardwareOnStartup</key> |
7140 | <map> | 7151 | <map> |
7141 | <key>Comment</key> | 7152 | <key>Comment</key> |
diff --git a/linden/indra/newview/llhudeffectlookat.cpp b/linden/indra/newview/llhudeffectlookat.cpp index 3a5bec2..b54101e 100644 --- a/linden/indra/newview/llhudeffectlookat.cpp +++ b/linden/indra/newview/llhudeffectlookat.cpp | |||
@@ -285,18 +285,36 @@ void LLHUDEffectLookAt::packData(LLMessageSystem *mesgsys) | |||
285 | 285 | ||
286 | // pack both target object and position | 286 | // pack both target object and position |
287 | // position interpreted as offset if target object is non-null | 287 | // position interpreted as offset if target object is non-null |
288 | ELookAtType target_type = mTargetType; | ||
289 | LLVector3d target_offset_global = mTargetOffsetGlobal; | ||
290 | LLViewerObject* target_object = (LLViewerObject*) mTargetObject; | ||
291 | |||
292 | LLVOAvatar* source_avatar = (LLVOAvatar*)(LLViewerObject*)mSourceObject; | ||
293 | bool is_self = source_avatar-> isSelf(); | ||
294 | bool is_private = gSavedSettings.getBOOL("PrivateLookAtTarget"); | ||
295 | |||
296 | if (is_private && is_self) | ||
297 | { | ||
298 | //this mimicks own avatar selected, consider not to change this | ||
299 | //because bots could profile other settings for evil client detection | ||
300 | target_type = LOOKAT_TARGET_SELECT; | ||
301 | target_offset_global.setVec(5.0, 0.0, 0.0); | ||
302 | target_object = mSourceObject; | ||
303 | } | ||
304 | |||
305 | |||
288 | if (mTargetObject) | 306 | if (mTargetObject) |
289 | { | 307 | { |
290 | htonmemcpy(&(packed_data[TARGET_OBJECT]), mTargetObject->mID.mData, MVT_LLUUID, 16); | 308 | htonmemcpy(&(packed_data[TARGET_OBJECT]), target_object->mID.mData, MVT_LLUUID, 16); |
291 | } | 309 | } |
292 | else | 310 | else |
293 | { | 311 | { |
294 | htonmemcpy(&(packed_data[TARGET_OBJECT]), LLUUID::null.mData, MVT_LLUUID, 16); | 312 | htonmemcpy(&(packed_data[TARGET_OBJECT]), LLUUID::null.mData, MVT_LLUUID, 16); |
295 | } | 313 | } |
296 | 314 | ||
297 | htonmemcpy(&(packed_data[TARGET_POS]), mTargetOffsetGlobal.mdV, MVT_LLVector3d, 24); | 315 | htonmemcpy(&(packed_data[TARGET_POS]), target_offset_global.mdV, MVT_LLVector3d, 24); |
298 | 316 | ||
299 | U8 lookAtTypePacked = (U8)mTargetType; | 317 | U8 lookAtTypePacked = (U8)target_type; |
300 | 318 | ||
301 | htonmemcpy(&(packed_data[LOOKAT_TYPE]), &lookAtTypePacked, MVT_U8, 1); | 319 | htonmemcpy(&(packed_data[LOOKAT_TYPE]), &lookAtTypePacked, MVT_U8, 1); |
302 | 320 | ||