From: Mircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Date: Thu, 27 Oct 2011 17:07:26 +0000 (+0300)
Subject: Increase / decrease the object count of the owner, not of the person spawning / remov... 
X-Git-Tag: xonotic-v0.6.0~35^2~18^2~111
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4cf1a2a34fa7f2dfb0c0b943638df7ba66d70f83;p=xonotic%2Fxonotic-data.pk3dir.git

Increase / decrease the object count of the owner, not of the person spawning / removing objects. As later on, we might have support for removing objects using other means.
---

diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc
index 6a9a7ed58..b21a1d6ae 100644
--- a/qcsrc/server/mutators/sandbox.qc
+++ b/qcsrc/server/mutators/sandbox.qc
@@ -137,17 +137,17 @@ entity sandbox_SpawnObject()
 	setorigin(e, trace_endpos);
 	e.angles_y = self.v_angle_y;
 
-	self.object_count += 1;
+	e.realowner.object_count += 1;
 
 	return e;
 }
 
 void sandbox_RemoveObject(entity e)
 {
+	e.realowner.object_count -= 1;
+
 	remove(e);
 	e = world;
-
-	self.object_count -= 1;
 }
 
 string sandbox_Storage_Save(entity e)