]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/t_items.qc
turn NIX into a mutator; fix keyhunt
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / t_items.qc
index 1d398d122f5b0fe072c5198e6d52ee8da3afa8d2..6025578a904b3f3c00b323ee8b456095fe7f8365 100644 (file)
@@ -709,6 +709,19 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
        }
        else
        {
+               self.items = itemid;
+               self.weapons = weaponid;
+
+               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 +828,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 +861,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 +1272,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 +1352,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");