From a1f82acebab97347d49a941f67a6df0ce78c29a6 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sat, 3 Dec 2011 17:52:09 +1000 Subject: Another possible fix for misplaced HUDs? From singularity commit 69e733ea86ebd7cd5a4acb40ef87735e5c428c53 by Shyotl. From singularity commit 080407d92f2846397472be1ab533a9da7f8b66cb by Shyotl. From singularity commit 88df12ddb6cecf7d46d64531123e4adc23862db1 by Shyotl. Plus some extra fom singularity, but not sure where it came from. --- linden/indra/newview/lldrawable.cpp | 35 +++++++++++++++++++++++++---- linden/indra/newview/lltoolpie.cpp | 7 ++++++ linden/indra/newview/llviewerobjectlist.cpp | 3 ++- 3 files changed, 40 insertions(+), 5 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/lldrawable.cpp b/linden/indra/newview/lldrawable.cpp index 5a383bc..7ab5ade 100644 --- a/linden/indra/newview/lldrawable.cpp +++ b/linden/indra/newview/lldrawable.cpp @@ -1225,6 +1225,12 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector* return; } } +// From singularity commit 69e733ea86ebd7cd5a4acb40ef87735e5c428c53 by Shyotl. +// TODO: Is THIS what is causing HUD monsters? + else + { + return; + } } @@ -1278,12 +1284,33 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update) return; } - LLCamera camera = transformCamera(camera_in); - - mDrawable->updateDistance(camera, force_update); - if (mDrawable->getVObj()) { + +// Some more taken from singularity, but not sure of the origin. + if (mDrawable->getVObj()->isAttachment()) + { + LLDrawable* parent = mDrawable->getParent(); + if (parent) + { + LLViewerObject *obj = parent->getVObj(); + if (obj && obj->isAvatar() && ((LLVOAvatar*)obj)->isImpostor()) + { + return; + } + } +// From singularity commit 69e733ea86ebd7cd5a4acb40ef87735e5c428c53 by Shyotl. +// TODO: Is THIS what is causing HUD monsters? + else + { + return; + } + } + + LLCamera camera = transformCamera(camera_in); + + mDrawable->updateDistance(camera, force_update); + LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren(); for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); iter != child_list.end(); iter++) diff --git a/linden/indra/newview/lltoolpie.cpp b/linden/indra/newview/lltoolpie.cpp index 429b9d4..7cab0eb 100644 --- a/linden/indra/newview/lltoolpie.cpp +++ b/linden/indra/newview/lltoolpie.cpp @@ -394,6 +394,13 @@ BOOL LLToolPie::pickAndShowMenu(BOOL always_show) object = (LLViewerObject*)object->getParent(); } +// From singularity commit 080407d92f2846397472be1ab533a9da7f8b66cb by Shyotl. +// TODO: Is THIS what is causing HUD monsters to cause crashes? + if (!object) + { + return TRUE; // unexpected, but escape + } + // Object is an avatar, so check for mute by id. LLVOAvatar* avatar = (LLVOAvatar*)object; std::string name = avatar->getFullname(); diff --git a/linden/indra/newview/llviewerobjectlist.cpp b/linden/indra/newview/llviewerobjectlist.cpp index ad92fe3..ea6ecd8 100644 --- a/linden/indra/newview/llviewerobjectlist.cpp +++ b/linden/indra/newview/llviewerobjectlist.cpp @@ -464,7 +464,8 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (objectp->getRegion() != regionp) { // Object changed region, so update it - objectp->setRegion(regionp); +// From singularity commit 88df12ddb6cecf7d46d64531123e4adc23862db1 by Shyotl. +// TODO: Is THIS what is causing HUD monsters? objectp->setRegion(regionp); objectp->updateRegion(regionp); // for LLVOAvatar } } -- cgit v1.1