]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/spawning.qc
Merge branch 'TimePath/experiments/csqc_prediction' into Mario/qc_physics
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / spawning.qc
index 94d6d2135a9ee70cc3781e4da6fb10d78b8784fb..ea62fcf19eba9c05d08169e827357b879ef3ba9a 100644 (file)
@@ -1,3 +1,18 @@
+#if defined(CSQC)
+#elif defined(MENUQC)
+#elif defined(SVQC)
+       #include "../../dpdefs/progsdefs.qh"
+    #include "../../dpdefs/dpextensions.qh"
+    #include "../../common/weapons/weapons.qh"
+    #include "spawning.qh"
+    #include "weaponsystem.qh"
+    #include "../t_items.qh"
+    #include "../autocvars.qh"
+    #include "../constants.qh"
+    #include "../defs.qh"
+    #include "../mutators/mutators_include.qh"
+#endif
+
 string W_Apply_Weaponreplace(string in)
 {
        float n = tokenize_console(in);
@@ -8,7 +23,7 @@ string W_Apply_Weaponreplace(string in)
        {
                replacement = "";
                s = argv(i);
-               
+
                for(j = WEP_FIRST; j <= WEP_LAST; ++j)
                {
                        e = get_weaponinfo(j);
@@ -33,7 +48,7 @@ void weapon_defaultspawnfunc(float wpn)
        string s;
        entity oldself;
        float i, j;
-       float f;
+       int f;
 
        if(self.classname != "droppedweapon" && self.classname != "replacedweapon")
        {
@@ -42,7 +57,7 @@ void weapon_defaultspawnfunc(float wpn)
                if(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
                {
                        objerror("Attempted to spawn a mutator-blocked weapon rejected");
-                       startitem_failed = TRUE;
+                       startitem_failed = true;
                        return;
                }
 
@@ -54,7 +69,7 @@ void weapon_defaultspawnfunc(float wpn)
                if(s == "")
                {
                        remove(self);
-                       startitem_failed = TRUE;
+                       startitem_failed = true;
                        return;
                }
                t = tokenize_console(s);
@@ -105,7 +120,7 @@ void weapon_defaultspawnfunc(float wpn)
                if(wpn == 0)
                {
                        remove(self);
-                       startitem_failed = TRUE;
+                       startitem_failed = true;
                        return;
                }
        }
@@ -131,28 +146,29 @@ void weapon_defaultspawnfunc(float wpn)
                        self.superweapons_finished = autocvar_g_balance_superweapons_time;
 
        // if we don't already have ammo, give us some ammo
-       if(!self.(e.current_ammo))
+       if(!self.(e.ammo_field))
        {
-               switch(e.current_ammo)
+               switch(e.ammo_field)
                {
                        case ammo_shells:  self.ammo_shells  = cvar("g_pickup_shells_weapon");  break;
                        case ammo_nails:   self.ammo_nails   = cvar("g_pickup_nails_weapon");   break;
                        case ammo_rockets: self.ammo_rockets = cvar("g_pickup_rockets_weapon"); break;
                        case ammo_cells:   self.ammo_cells   = cvar("g_pickup_cells_weapon");   break;
+                       case ammo_plasma:  self.ammo_plasma  = cvar("g_pickup_plasma_weapon");  break;
                        case ammo_fuel:    self.ammo_fuel    = cvar("g_pickup_fuel_weapon");    break;
                }
        }
 
-       #if 0
+       #if 0 // WEAPONTODO
        if(e.items)
        {
                for(i = 0, j = 1; i < 24; ++i, j *= 2)
                {
                        if(e.items & j)
                        {
-                               ammofield = Item_CounterField(j);
-                               if(!self.ammofield)
-                                       self.ammofield = cvar(strcat("g_pickup_", Item_CounterFieldName(j), "_weapon"));
+                               ammotype = Item_CounterField(j);
+                               if(!self.ammotype)
+                                       self.ammotype = cvar(strcat("g_pickup_", Item_CounterFieldName(j), "_weapon"));
                        }
                }
        }
@@ -160,7 +176,7 @@ void weapon_defaultspawnfunc(float wpn)
 
        // pickup anyway
        if(g_pickup_weapons_anyway)
-               self.pickup_anyway = TRUE;
+               self.pickup_anyway = true;
 
        f = FL_WEAPON;
 
@@ -173,6 +189,8 @@ void weapon_defaultspawnfunc(float wpn)
                f |= FL_NO_WEAPON_STAY;
 
        StartItem(e.model, "weapons/weaponpickup.wav", self.respawntime, self.respawntimejitter, e.message, 0, e.weapon, f, weapon_pickupevalfunc, e.bot_pickupbasevalue);
+       #if 0 // WEAPONTODO
        if (self.modelindex) // don't precache if self was removed
                WEP_ACTION(e.weapon, WR_INIT);
+       #endif
 }