diff options
-rw-r--r-- | indra/newview/llviewerobject.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewerobjectlist.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llviewerobjectlist.h | 1 | ||||
-rw-r--r-- | indra/newview/llworld.cpp | 2 |
4 files changed, 24 insertions, 0 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 090d3cadd4..d1661290f2 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -3009,6 +3009,8 @@ void LLViewerObject::setScale(const LLVector3 &scale, BOOL damped) { if (!mOnMap) { + llassert_always(LLWorld::getInstance()->getRegionFromHandle(getRegion()->getHandle())); + gObjectList.addToMap(this); mOnMap = TRUE; } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 970cc2e2a7..5d6c738c6d 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1124,6 +1124,22 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset) LLWorld::getInstance()->shiftRegions(offset); } +//debug code +bool LLViewerObjectList::hasMapObjectInRegion(LLViewerRegion* regionp) +{ + for (vobj_list_t::iterator iter = mMapObjects.begin(); iter != mMapObjects.end(); ++iter) + { + LLViewerObject* objectp = *iter; + + if(objectp->isDead() || objectp->getRegion() == regionp) + { + return true ; + } + } + + return false ; +} + void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) { LLColor4 above_water_color = LLUIColorTable::instance().getColor( "NetMapOtherOwnAboveWater" ); @@ -1142,6 +1158,9 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) for (vobj_list_t::iterator iter = mMapObjects.begin(); iter != mMapObjects.end(); ++iter) { LLViewerObject* objectp = *iter; + + llassert_always(!objectp->isDead()); + if (!objectp->getRegion() || objectp->isOrphaned() || objectp->isAttachment()) { continue; diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index fda3d6899d..8cff8e988a 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -87,6 +87,7 @@ public: void shiftObjects(const LLVector3 &offset); + bool hasMapObjectInRegion(LLViewerRegion* regionp) ; void renderObjectsForMap(LLNetMap &netmap); void renderObjectBounds(const LLVector3 ¢er); diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 399442e5c4..9db6d5e08c 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -281,6 +281,8 @@ void LLWorld::removeRegion(const LLHost &host) delete regionp; updateWaterObjects(); + + llassert_always(!gObjectList.hasMapObjectInRegion(regionp)) ; } |