From 64395d21592ecd35b6f476d38df1a46bd8edc1a8 Mon Sep 17 00:00:00 2001
From: Josh Bell <josh@lindenlab.com>
Date: Mon, 26 Mar 2007 17:30:51 +0000
Subject: [PATCH] Effectively: merge 59238:59702 Branch_1-13-4 --> release
 EXCEPT for the back out (r59497) and re-patch (r59531) of upload-queue, and
 fixes merged directly from Maintenance.

merge -r 59328:59428 Branch_1-13-4 --> release

* address regex needs "s" option to support multiline addresses.  Patched previously, not sure how it got dropped.
* added new promo code to accommodate printer error
* Fix for SL-37108 "SVC-55: look at may be broken"
* Paired/reviewed with Qarl
* Release notes for Release Notes for 1.13.4(59329)
* merge release-candidate@58928 long-live-legacy-particles@59317 -> Branch_1-13-14

SKIP -r 59428:59437 (temporary), 59437:59465 (from release), 59465:59497 (back out of upload-queue)

merge -r 59497:59510 Branch_1-13-4 --> release

* SL-37932 legacy particle clean up
* SL-33228 llParticleSystem( [] ) may not shut down reliably
* SL-37909 llParticleSystem([ ]) bug now affects unlinked and root prims

SKIP -r 59510:59531 (re-patch of upload-queue)

merge -r 59531:59585 Branch_1-13-4 --> release

* blacklist and release notes updates

SKIP -r 59585:59656 (patches from maintenance)

merge -r 59656:59691 Branch_1-13-4 --> release

* blacklist and release notes updates

SKIP -r 59691:59702 (already ported to release)
---
 indra/lscript/lscript_library.h  |  4 ++--
 indra/newview/llviewerobject.cpp | 17 ++++++++++++++++-
 indra/newview/llviewerobject.h   |  1 +
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/indra/lscript/lscript_library.h b/indra/lscript/lscript_library.h
index 007d36fbcd6..ed6e3bc1def 100644
--- a/indra/lscript/lscript_library.h
+++ b/indra/lscript/lscript_library.h
@@ -407,11 +407,11 @@ class LLScriptLibData
 		}
 	}
 
-	LLScriptLibData(LLVector3 &vec) : mType(LST_VECTOR), mInteger(0), mFP(0.f), mKey(NULL), mString(NULL), mVec(vec), mQuat(), mListp(NULL)
+	LLScriptLibData(const LLVector3 &vec) : mType(LST_VECTOR), mInteger(0), mFP(0.f), mKey(NULL), mString(NULL), mVec(vec), mQuat(), mListp(NULL)
 	{
 	}
 
-	LLScriptLibData(LLQuaternion &quat) : mType(LST_QUATERNION), mInteger(0), mFP(0.f), mKey(NULL), mString(NULL), mVec(), mQuat(quat), mListp(NULL)
+	LLScriptLibData(const LLQuaternion &quat) : mType(LST_QUATERNION), mInteger(0), mFP(0.f), mKey(NULL), mString(NULL), mVec(), mQuat(quat), mListp(NULL)
 	{
 	}
 
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index a09ce3011f5..bd8ac806f58 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -1406,8 +1406,14 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
 				// Unpack particle system data
 				//
 				if (value & 0x8)
+				{
 					unpackParticleSource(*dp, owner_id);
-
+				}
+				else
+				{
+					deleteParticleSource();
+				}
+				
 				// Mark all extra parameters not used
 				std::map<U16, ExtraParameter*>::iterator iter;
 				for (iter = mExtraParameterList.begin(); iter != mExtraParameterList.end(); ++iter)
@@ -4063,6 +4069,15 @@ void LLViewerObject::unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_
 	}
 }
 
+void LLViewerObject::deleteParticleSource()
+{
+	if (mPartSourcep.notNull())
+	{
+		mPartSourcep->setDead();
+		mPartSourcep = NULL;
+	}
+}
+
 // virtual
 void LLViewerObject::updateDrawable(BOOL force_damped)
 {
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index 80d32409043..3e885233fd5 100644
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -527,6 +527,7 @@ class LLViewerObject : public LLPrimitive, public LLRefCount
 
 	void unpackParticleSource(const S32 block_num, const LLUUID& owner_id);
 	void unpackParticleSource(LLDataPacker &dp, const LLUUID& owner_id);
+	void deleteParticleSource();
 
 private:
 	void setNameValueList(const std::string& list);		// clears nv pairs and then individually adds \n separated NV pairs from \0 terminated string
-- 
GitLab