summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r--indra/newview/llvoavatar.cpp73
1 files changed, 65 insertions, 8 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 80c6805ead..f9dfa971d9 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -3417,10 +3417,62 @@ void LLVOAvatar::updateDebugText()
std::string output;
if (motionp->getName().empty())
{
+ std::string name;
+ if (gAgent.isGodlikeWithoutAdminMenuFakery() || isSelf())
+ {
+ name = motionp->getID().asString();
+ LLVOAvatar::AnimSourceIterator anim_it = mAnimationSources.begin();
+ for (; anim_it != mAnimationSources.end(); ++anim_it)
+ {
+ if (anim_it->second == motionp->getID())
+ {
+ LLViewerObject* object = gObjectList.findObject(anim_it->first);
+ if (!object)
+ {
+ break;
+ }
+ if (object->isAvatar())
+ {
+ if (mMotionController.mIsSelf)
+ {
+ // Searching inventory by asset id is really long
+ // so just mark as inventory
+ // Also item is likely to be named by LLPreviewAnim
+ name += "(inventory)";
+ }
+ }
+ else
+ {
+ LLViewerInventoryItem* item = NULL;
+ if (!object->isInventoryDirty())
+ {
+ item = object->getInventoryItemByAsset(motionp->getID());
+ }
+ if (item)
+ {
+ name = item->getName();
+ }
+ else if (object->isAttachment())
+ {
+ name += "(" + getAttachmentItemName() + ")";
+ }
+ else
+ {
+ // in-world object, name or content unknown
+ name += "(in-world)";
+ }
+ }
+ break;
+ }
+ }
+ }
+ else
+ {
+ name = LLUUID::null.asString();
+ }
+
output = llformat("%s - %d",
- gAgent.isGodlikeWithoutAdminMenuFakery() ?
- motionp->getID().asString().c_str() :
- LLUUID::null.asString().c_str(),
+ name.c_str(),
(U32)motionp->getPriority());
}
else
@@ -5208,13 +5260,13 @@ void LLVOAvatar::resetAnimations()
// Override selectively based on avatar sex and whether we're using new
// animations.
-LLUUID LLVOAvatar::remapMotionID(const LLUUID& id)
+LLUUID LLVOAvatar::remapMotionID(const LLUUID& id, ESex gender)
{
BOOL use_new_walk_run = gSavedSettings.getBOOL("UseNewWalkRun");
LLUUID result = id;
// start special case female walk for female avatars
- if (getSex() == SEX_FEMALE)
+ if (gender == SEX_FEMALE)
{
if (id == ANIM_AGENT_WALK)
{
@@ -5264,7 +5316,7 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)
{
LL_DEBUGS() << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL;
- LLUUID remap_id = remapMotionID(id);
+ LLUUID remap_id = remapMotionID(id, getSex());
if (remap_id != id)
{
@@ -5286,8 +5338,13 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate)
{
LL_DEBUGS() << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL;
- LLUUID remap_id = remapMotionID(id);
-
+ LLUUID remap_id = remapMotionID(id, getSex());
+ if (findMotion(remap_id) == NULL)
+ {
+ //possibility of encountering animation from the previous gender
+ remap_id = remapMotionID(id, (getSex() == SEX_MALE) ? SEX_FEMALE : SEX_MALE);
+ }
+
if (remap_id != id)
{
LL_DEBUGS() << "motion resultant " << remap_id.asString() << " " << gAnimLibrary.animationName(remap_id) << LL_ENDL;