summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyler Eastridge <felix.wolfz@gmail.com>2024-04-16 13:10:49 -0400
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-04-16 22:26:30 +0300
commit180a2aaacb1c86772c323a6c0d270d332d13c9e5 (patch)
tree492e41ebccf40897f7312b6726ac8d90e815609a
parent495a402b4acad516dc4359697f73a528282f8226 (diff)
Remove animesh networked skeleton reset for now
-rw-r--r--indra/newview/llhudeffectresetskeleton.cpp29
-rw-r--r--indra/newview/llviewermenu.cpp42
2 files changed, 34 insertions, 37 deletions
diff --git a/indra/newview/llhudeffectresetskeleton.cpp b/indra/newview/llhudeffectresetskeleton.cpp
index 8afa231fc5..21f7cbde26 100644
--- a/indra/newview/llhudeffectresetskeleton.cpp
+++ b/indra/newview/llhudeffectresetskeleton.cpp
@@ -118,7 +118,13 @@ void LLHUDEffectResetSkeleton::unpackData(LLMessageSystem *mesgsys, S32 blocknum
LLUUID target_id;
htolememcpy(target_id.mData, &(packed_data[TARGET_OBJECT]), MVT_LLUUID, 16);
-
+
+ // The purpose for having a target ID is if we want to reset animesh, or
+ // other things in the future.
+ // I implemented this, but due to issues regarding various permission
+ // checks, I scrapped it for now. --Chaser Zaks
+ // See https://github.com/secondlife/viewer/pull/1212 for additional info
+
if (target_id.isNull())
{
target_id = source_id;
@@ -185,22 +191,19 @@ void LLHUDEffectResetSkeleton::update()
return;
}
- bool owned = false;
- if(mTargetObject->isAnimatedObject())
+ if (mTargetObject->isAvatar())
{
- owned = mTargetObject->mOwnerID == mSourceObject->getID();
+ // Only the owner of a avatar can reset their skeleton like this
+ if (mSourceObject->getID() == mTargetObject->getID())
+ {
+ LLVOAvatar* avatar = (LLVOAvatar*)(LLViewerObject*)mTargetObject;
+ avatar->resetSkeleton(mResetAnimations);
+ }
}
else
{
- owned = mTargetObject->getID() == mSourceObject->getID();
- }
-
- if (owned)
- {
- if (mTargetObject->isAvatar() || mTargetObject->isAnimatedObject())
- {
- ((LLVOAvatar*)(LLViewerObject*)mTargetObject)->resetSkeleton(mResetAnimations);
- }
+ LL_WARNS() << mSourceObject->getID() << " attempted to reset skeleton on "
+ << mTargetObject->getID() << ", but it is not a avatar!" << LL_ENDL;
}
markDead();
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 58b9d7a366..cb2a58d675 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -6506,19 +6506,17 @@ class LLAvatarResetSkeleton: public view_listener_t
}
if(avatar)
{
- bool owned = false;
- if(avatar->isAnimatedObject())
+ if(avatar->getID() == gAgent.getID())
{
- owned = avatar->mOwnerID == gAgent.getID();
+ LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, owned);
+ effectp->setSourceObject(gAgentAvatarp);
+ effectp->setTargetObject((LLViewerObject*)avatar);
+ effectp->setResetAnimations(false);
}
else
{
- owned = avatar->getID() == gAgent.getID();
+ effectp->setResetAnimations(false);
}
- LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, owned);
- effectp->setSourceObject(gAgentAvatarp);
- effectp->setTargetObject((LLViewerObject*)avatar);
- effectp->setResetAnimations(false);
}
return true;
}
@@ -6545,19 +6543,17 @@ class LLAvatarResetSkeletonAndAnimations : public view_listener_t
LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());
if (avatar)
{
- bool owned = false;
- if(avatar->isAnimatedObject())
+ if(avatar->getID() == gAgent.getID())
{
- owned = avatar->mOwnerID == gAgent.getID();
+ LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, true);
+ effectp->setSourceObject(gAgentAvatarp);
+ effectp->setTargetObject((LLViewerObject*)avatar);
+ effectp->setResetAnimations(true);
}
else
{
- owned = avatar->getID() == gAgent.getID();
+ effectp->setResetAnimations(true);
}
- LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, owned);
- effectp->setSourceObject(gAgentAvatarp);
- effectp->setTargetObject((LLViewerObject*)avatar);
- effectp->setResetAnimations(true);
}
return true;
}
@@ -6570,19 +6566,17 @@ class LLAvatarResetSelfSkeletonAndAnimations : public view_listener_t
LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());
if (avatar)
{
- bool owned = false;
- if(avatar->isAnimatedObject())
+ if(avatar->getID() == gAgent.getID())
{
- owned = avatar->mOwnerID == gAgent.getID();
+ LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, true);
+ effectp->setSourceObject(gAgentAvatarp);
+ effectp->setTargetObject((LLViewerObject*)avatar);
+ effectp->setResetAnimations(true);
}
else
{
- owned = avatar->getID() == gAgent.getID();
+ effectp->setResetAnimations(true);
}
- LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, owned);
- effectp->setSourceObject(gAgentAvatarp);
- effectp->setTargetObject((LLViewerObject*)avatar);
- effectp->setResetAnimations(true);
}
else
{