From 2f638300cd7e2c3ae675125ade037205403b5c54 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 30 Jan 2013 10:14:16 -0500 Subject: SH-3780 WIP - more checking on appearance param values --- indra/newview/llvoavatar.cpp | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 90887b5861..8f5d2a6aad 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6703,26 +6703,36 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe } } - if (contents.mAppearanceVersion < 0) // not set explicitly, try to get from visual param. + LLVisualParam* appearance_version_param = getVisualParam(11000); + S32 param_appearance_version = -1; + if (appearance_version_param) { - LLVisualParam* appearance_version_param = getVisualParam(11000); - if (appearance_version_param) + std::vector::iterator it = std::find(contents.mParams.begin(), contents.mParams.end(),appearance_version_param); + if (it != contents.mParams.end()) { - std::vector::iterator it = std::find(contents.mParams.begin(), contents.mParams.end(),appearance_version_param); - if (it != contents.mParams.end()) - { - S32 index = it - contents.mParams.begin(); - llinfos << "index: " << index << llendl; - S32 appearance_version = llround(contents.mParamWeights[index]); - contents.mAppearanceVersion = appearance_version; - llinfos << "appversion set by appearance_version param: " << contents.mAppearanceVersion << llendl; - } + S32 index = it - contents.mParams.begin(); + llinfos << "index: " << index << llendl; + param_appearance_version = llround(contents.mParamWeights[index]); + LL_DEBUGS("Avatar") << "appversion req by appearance_version param: " << contents.mAppearanceVersion << llendl; } } + if ((contents.mAppearanceVersion) >= 0 && + (param_appearance_version >= 0) && + (contents.mAppearanceVersion != param_appearance_version)) + { + llwarns << "inconsistent appearance_version settings - field: " << + contents.mAppearanceVersion << ", param: " << param_appearance_version << llendl; + } + if (contents.mAppearanceVersion < 0 && + param_appearance_version >= 0) // not set explicitly, try to get from visual param. + { + contents.mAppearanceVersion = param_appearance_version; + LL_DEBUGS("Avatar") << "appversion set by appearance_version param: " << contents.mAppearanceVersion << llendl; + } if (contents.mAppearanceVersion < 0) // still not set, go with 0. { contents.mAppearanceVersion = 0; - llinfos << "appversion set by default: " << contents.mAppearanceVersion << llendl; + LL_DEBUGS("Avatar") << "appversion set by default: " << contents.mAppearanceVersion << llendl; } } -- cgit v1.2.3