From: Mircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Date: Wed, 4 Apr 2012 12:55:20 +0000 (+0300)
Subject: Call the new hook after everything else has been done, otherwise physics might get... 
X-Git-Tag: xonotic-v0.7.0~111^2~20
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=68740440bd42805dc22788aa7c7bdc9eb87860c2;p=xonotic%2Fxonotic-data.pk3dir.git

Call the new hook after everything else has been done, otherwise physics might get overwritten
---

diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc
index 1870dddf00..e1d405da5c 100644
--- a/qcsrc/server/t_items.qc
+++ b/qcsrc/server/t_items.qc
@@ -751,13 +751,6 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
 	self.weapons = weaponid;
 	self.flags = FL_ITEM | itemflags;
 
-	if(MUTATOR_CALLHOOK(Item_Spawn))
-	{
-		startitem_failed = TRUE;
-		remove(self);
-		return;
-	}
-
 	// is it a dropped weapon?
 	if (self.classname == "droppedweapon")
 	{
@@ -931,6 +924,14 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
 	}
 	else
 		Item_Reset();
+
+	// call this hook after everything else has been done
+	if(MUTATOR_CALLHOOK(Item_Spawn))
+	{
+		startitem_failed = TRUE;
+		remove(self);
+		return;
+	}
 }
 
 /* replace items in minstagib