]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
also allow overriding pickup sound by setting the item_pickupsound key
authorRudolf Polzer <divverent@alientrap.org>
Fri, 17 Dec 2010 17:53:59 +0000 (18:53 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 17 Dec 2010 17:53:59 +0000 (18:53 +0100)
qcsrc/server/t_items.qc

index 166aad589b801f94514ac74ecbd73a8fb434a30f..2ca9162f858229c309d66050460cace9909c87eb 100644 (file)
@@ -712,6 +712,11 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                        return;
                }
 
+               if(self.model != "")
+                       itemmodel = self.model;
+               if(self.item_pickupsound != "")
+                       pickupsound = self.item_pickupsound;
+
                self.reset = Item_Reset;
                // it's a level item
                if(self.spawnflags & 1)
@@ -843,10 +848,7 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
        self.bot_pickup = TRUE;
        self.bot_pickupevalfunc = pickupevalfunc;
        self.bot_pickupbasevalue = pickupbasevalue;
-       if(self.model == "")
-               self.mdl = itemmodel;
-       else
-               self.mdl = self.model;
+       self.mdl = itemmodel;
        self.item_pickupsound = pickupsound;
        // let mappers override respawntime
        if(!self.respawntime) // both set