]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/t_items.qc
g_pickup_<ammotype>_weapon: the amount of that ammo type you get for picking up a...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / t_items.qc
index 1b6c21710df3cd78b309b35a0756e70ea4f43d5c..07cc60223e4740926ee3b0dccae354498b41a19b 100644 (file)
@@ -55,7 +55,7 @@ float Item_Customize()
        }
        else
        {
-               if(g_ghost_items && self.respawntime > 0) // if respawntime is -1, this item does not respawn
+               if(g_ghost_items)
                {
                        self.colormod = stov(cvar_string("g_ghost_items_color"));
                        self.glowmod = self.colormod;
@@ -106,7 +106,7 @@ void Item_Show (entity e, float mode)
 
                e.spawnshieldtime = 0; // field indicates whether picking it up may give you anything other than the weapon
        }
-       else if(g_ghost_items && self.respawntime > 0) // if respawntime is -1, this item does not respawn
+       else if(g_ghost_items)
        {
                // make the item translucent green and not touchable
                e.model = e.mdl;
@@ -233,9 +233,13 @@ void Item_ScheduleRespawnIn(entity e, float t)
 
 void Item_ScheduleRespawn(entity e)
 {
-       Item_Show(e, 0);
-       if(e.respawntime > 0) // if respawntime is -1, this item does not respawn
+       if(e.respawntime > 0)
+       {
+               Item_Show(e, 0);
                Item_ScheduleRespawnIn(e, ITEM_RESPAWNTIME(e));
+       }
+       else // if respawntime is -1, this item does not respawn
+               Item_Show(e, -1);
 }
 
 void Item_ScheduleInitialRespawn(entity e)
@@ -1048,7 +1052,7 @@ void weapon_defaultspawnfunc(float wpn)
                        {
                                ammofield = Item_CounterField(j);
                                if(!self.ammofield)
-                                       self.ammofield = cvar(strcat("g_pickup_", Item_CounterFieldName(j)));
+                                       self.ammofield = cvar(strcat("g_pickup_", Item_CounterFieldName(j)), "_weapon");
                        }
                }
        }
@@ -1193,7 +1197,7 @@ void spawnfunc_item_armor_small (void) {
                self.max_armorvalue = g_pickup_armorsmall_max;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_armorsmall_anyway;
-       StartItem ("models/items/g_a1.md3", "misc/armor1.wav", g_pickup_respawntime_short, g_pickup_respawntimejitter_short, "5 Armor", IT_ARMOR_SHARD, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
+       StartItem ("models/items/item_armor_small.md3", "misc/armor1.wav", g_pickup_respawntime_short, g_pickup_respawntimejitter_short, "5 Armor", IT_ARMOR_SHARD, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_LOW);
 }
 
 void spawnfunc_item_armor_medium (void) {
@@ -1203,7 +1207,7 @@ void spawnfunc_item_armor_medium (void) {
                self.max_armorvalue = g_pickup_armormedium_max;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_armormedium_anyway;
-       StartItem ("models/items/g_armormedium.md3", "misc/armor10.wav", g_pickup_respawntime_medium, g_pickup_respawntimejitter_medium, "25 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_MID);
+       StartItem ("models/items/item_armor_medium.md3", "misc/armor10.wav", g_pickup_respawntime_medium, g_pickup_respawntimejitter_medium, "25 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_MID);
 }
 
 void spawnfunc_item_armor_big (void) {
@@ -1213,7 +1217,7 @@ void spawnfunc_item_armor_big (void) {
                self.max_armorvalue = g_pickup_armorbig_max;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_armorbig_anyway;
-       StartItem ("models/items/g_a50.md3", "misc/armor17_5.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "50 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, 20000);
+       StartItem ("models/items/item_armor_big.md3", "misc/armor17_5.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "50 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, 20000);
 }
 
 void spawnfunc_item_armor_large (void) {
@@ -1223,7 +1227,7 @@ void spawnfunc_item_armor_large (void) {
                self.max_armorvalue = g_pickup_armorlarge_max;
        if(!self.pickup_anyway)
                self.pickup_anyway = g_pickup_armorlarge_anyway;
-       StartItem ("models/items/g_a25.md3", "misc/armor25.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "100 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_HIGH);
+       StartItem ("models/items/item_armor_large.md3", "misc/armor25.wav", g_pickup_respawntime_long, g_pickup_respawntimejitter_long, "100 Armor", IT_ARMOR, 0, 0, commodity_pickupevalfunc, BOT_PICKUP_RATING_HIGH);
 }
 
 void spawnfunc_item_health_small (void) {