]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/t_items.qc
Merge commit 'origin/master' into divVerent/tag_seeker
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / t_items.qc
index 1d398d122f5b0fe072c5198e6d52ee8da3afa8d2..02ad99fc991c9917f14484e118a154ed16f4037b 100644 (file)
@@ -48,8 +48,7 @@ float Item_Customize()
        if(self.weapons != (self.weapons & other.weapons))
        {
                self.colormod = '0 0 0';
-               if(cvar("gameversion") >= 20600) // only do this for 2.6 and above FIXME remove this check when making 2.6
-                       self.glowmod = self.colormod;
+               self.glowmod = self.colormod;
                self.alpha = 0.5 + 0.5 * g_ghost_items; // halfway more alpha
                return TRUE;
        }
@@ -58,8 +57,7 @@ float Item_Customize()
                if(g_ghost_items)
                {
                        self.colormod = stov(cvar_string("g_ghost_items_color"));
-                       if(cvar("gameversion") >= 20600) // only do this for 2.6 and above FIXME remove this check when making 2.6
-                               self.glowmod = self.colormod;
+                       self.glowmod = self.colormod;
                        self.alpha = g_ghost_items;
                        return TRUE;
                }
@@ -77,8 +75,7 @@ void Item_Show (entity e, float mode)
                e.model = e.mdl;
                e.solid = SOLID_TRIGGER;
                e.colormod = '0 0 0';
-               if(cvar("gameversion") >= 20600) // only do this for 2.6 and above FIXME remove this check when making 2.6
-                       self.glowmod = self.colormod;
+               self.glowmod = self.colormod;
                e.alpha = 0;
                e.customizeentityforclient = func_null;
 
@@ -90,8 +87,7 @@ void Item_Show (entity e, float mode)
                e.model = string_null;
                e.solid = SOLID_NOT;
                e.colormod = '0 0 0';
-               if(cvar("gameversion") >= 20600) // only do this for 2.6 and above FIXME remove this check when making 2.6
-                       self.glowmod = self.colormod;
+               self.glowmod = self.colormod;
                e.alpha = 0;
                e.customizeentityforclient = func_null;
 
@@ -103,8 +99,7 @@ void Item_Show (entity e, float mode)
                e.model = e.mdl;
                e.solid = SOLID_TRIGGER; // can STILL be picked up!
                e.colormod = '0 0 0';
-               if(cvar("gameversion") >= 20600) // only do this for 2.6 and above FIXME remove this check when making 2.6
-                       self.glowmod = self.colormod;
+               self.glowmod = self.colormod;
                e.effects |= EF_STARDUST;
                e.customizeentityforclient = Item_Customize;
 
@@ -116,8 +111,7 @@ void Item_Show (entity e, float mode)
                e.model = e.mdl;
                e.solid = SOLID_NOT;
                e.colormod = stov(cvar_string("g_ghost_items_color"));
-               if(cvar("gameversion") >= 20600) // only do this for 2.6 and above FIXME remove this check when making 2.6
-                       self.glowmod = self.colormod;
+               self.glowmod = self.colormod;
                e.alpha = g_ghost_items;
                e.customizeentityforclient = func_null;
 
@@ -129,8 +123,7 @@ void Item_Show (entity e, float mode)
                e.model = string_null;
                e.solid = SOLID_NOT;
                e.colormod = stov(cvar_string("g_ghost_items_color"));
-               if(cvar("gameversion") >= 20600) // only do this for 2.6 and above FIXME remove this check when making 2.6
-                       self.glowmod = self.colormod;
+               self.glowmod = self.colormod;
                e.alpha = 0;
                e.customizeentityforclient = func_null;
 
@@ -689,6 +682,9 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
 {
        startitem_failed = FALSE;
 
+       self.items = itemid;
+       self.weapons = weaponid;
+
        // is it a dropped weapon?
        if (self.classname == "droppedweapon")
        {
@@ -709,6 +705,16 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
        }
        else
        {
+               if(MUTATOR_CALLHOOK(FilterItem)) // error means we do not want the item
+               {
+                       startitem_failed = TRUE;
+                       remove(self);
+                       return;
+               }
+
+               itemid = self.items;
+               weaponid = self.weapons;
+
                self.reset = Item_Reset;
                // it's a level item
                if(self.spawnflags & 1)
@@ -815,35 +821,6 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                                return;
                        }
                }
-               else if (g_nixnex)
-               {
-                       local float rm;
-
-                       rm = 1;
-                       switch (itemid)
-                       {
-                               case IT_HEALTH:
-                               case IT_5HP:
-                               case IT_25HP:
-                               case IT_ARMOR:
-                               case IT_ARMOR_SHARD:
-                                       if (cvar("g_nixnex_with_healtharmor"))
-                                               rm = 0;
-                                       break;
-                               case IT_STRENGTH:
-                               case IT_INVINCIBLE:
-                                       if (cvar("g_nixnex_with_powerups"))
-                                               rm = 0;
-                                       break;
-                       }
-
-                       if(rm)
-                       {
-                               startitem_failed = TRUE;
-                               remove (self);
-                               return;
-                       }
-               }
                else if (!cvar("g_pickup_items") && itemid != IT_STRENGTH && itemid != IT_INVINCIBLE && itemid != IT_HEALTH)
                {
                        startitem_failed = TRUE;
@@ -877,8 +854,6 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                self.respawntimejitter = defaultrespawntimejitter;
        }
        self.netname = itemname;
-       self.items = itemid;
-       self.weapons = weaponid;
        self.flags = FL_ITEM | itemflags;
        self.touch = Item_Touch;
        setmodel (self, self.mdl); // precision set below
@@ -1290,7 +1265,7 @@ void spawnfunc_item_health_mega (void) {
 }
 
 // support old misnamed entities
-void spawnfunc_item_armor1() { spawnfunc_item_armor_small(); }  // FIXME: in Quake this is green armor, in Nexuiz maps it is an armor shard
+void spawnfunc_item_armor1() { spawnfunc_item_armor_small(); }  // FIXME: in Quake this is green armor, in Xonotic maps it is an armor shard
 void spawnfunc_item_armor25() { spawnfunc_item_armor_large(); }
 void spawnfunc_item_health1() { spawnfunc_item_health_small(); }
 void spawnfunc_item_health25() { spawnfunc_item_health_medium(); }
@@ -1370,13 +1345,6 @@ void spawnfunc_target_items (void)
        float n, i, j;
        entity e;
 
-       if(g_nixnex)
-       {
-               // items triggers cannot work in nixnex (as they change weapons/ammo)
-               remove(self);
-               return;
-       }
-
        self.use = target_items_use;
        if(!self.strength_finished)
                self.strength_finished = cvar("g_balance_powerup_strength_time");
@@ -1519,12 +1487,6 @@ void spawnfunc_item_jetpack(void)
        StartItem ("models/items/g_jetpack.md3", "misc/itempickup.wav", g_pickup_respawntime_powerup, g_pickup_respawntimejitter_powerup, "Jet pack", IT_JETPACK, 0, FL_POWERUP, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
 }
 
-// we no longer have the seeker
-void spawnfunc_weapon_seeker()
-{
-       spawnfunc_weapon_fireball();
-}
-
 
 #define OP_SET 0
 #define OP_MIN 1