From: Mario <mario@smbclan.net>
Date: Sat, 16 Jan 2016 11:32:23 +0000 (+1000)
Subject: Fix a crash and a warning with clones
X-Git-Tag: xonotic-v0.8.2~1226
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3c6c641f9cffd1aa7f780d90e8aed9e4ac3de04e;p=xonotic%2Fxonotic-data.pk3dir.git

Fix a crash and a warning with clones
---

diff --git a/qcsrc/common/effects/qc/globalsound.qc b/qcsrc/common/effects/qc/globalsound.qc
index 02d8756aab..061ec2c74b 100644
--- a/qcsrc/common/effects/qc/globalsound.qc
+++ b/qcsrc/common/effects/qc/globalsound.qc
@@ -299,6 +299,7 @@
 		void _GlobalSound(entity this, entity gs, entity ps, string sample, int chan, int voicetype, bool fake)
 		{
 			if (gs == NULL && ps == NULL && sample == "") return;
+			if(this.classname == "body") return;
 			float r = random();
 			if (sample != "") sample = GlobalSound_sample(sample, r);
 			switch (voicetype)
diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc
index c6dfc11745..f5f5ad905d 100644
--- a/qcsrc/server/cl_player.qc
+++ b/qcsrc/server/cl_player.qc
@@ -106,6 +106,7 @@ void CopyBody(entity this, float keepvelocity)
 	setsize(clone, this.mins, this.maxs);
 	clone.prevorigin = this.origin;
 	clone.reset = SUB_Remove;
+	clone._ps = this._ps;
 
 	Drag_MoveDrag(this, clone);