]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/t_items.qc
Remove some `#ifdef GMQCC` conditionals
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / t_items.qc
index b89a81f688478dc79f675dd6968612f210ba78d3..88b4c7a032e7a85b9cc873850a4c6693be5b409f 100644 (file)
@@ -48,7 +48,7 @@ void ItemDrawSimple()
 
 void ItemRead(float _IsNew)
 {
-    float sf = ReadByte();
+    int sf = ReadByte();
 
     if(sf & ISF_LOCATION)
     {
@@ -137,14 +137,14 @@ void ItemRead(float _IsNew)
 
 
 
-            if(fexists(sprintf("%s%s.md3", _fn2, autocvr_cl_simpleitems_postfix)))
-                self.mdl = strzone(sprintf("%s%s.md3", _fn2, autocvr_cl_simpleitems_postfix));
-            else if(fexists(sprintf("%s%s.dpm", _fn2, autocvr_cl_simpleitems_postfix)))
-                self.mdl = strzone(sprintf("%s%s.dpm", _fn2, autocvr_cl_simpleitems_postfix));
-            else if(fexists(sprintf("%s%s.iqm", _fn2, autocvr_cl_simpleitems_postfix)))
-                self.mdl = strzone(sprintf("%s%s.iqm", _fn2, autocvr_cl_simpleitems_postfix));
-            else if(fexists(sprintf("%s%s.obj", _fn2, autocvr_cl_simpleitems_postfix)))
-                self.mdl = strzone(sprintf("%s%s.obj", _fn2, autocvr_cl_simpleitems_postfix));
+            if(fexists(sprintf("%s%s.md3", _fn2, autocvar_cl_simpleitems_postfix)))
+                self.mdl = strzone(sprintf("%s%s.md3", _fn2, autocvar_cl_simpleitems_postfix));
+            else if(fexists(sprintf("%s%s.dpm", _fn2, autocvar_cl_simpleitems_postfix)))
+                self.mdl = strzone(sprintf("%s%s.dpm", _fn2, autocvar_cl_simpleitems_postfix));
+            else if(fexists(sprintf("%s%s.iqm", _fn2, autocvar_cl_simpleitems_postfix)))
+                self.mdl = strzone(sprintf("%s%s.iqm", _fn2, autocvar_cl_simpleitems_postfix));
+            else if(fexists(sprintf("%s%s.obj", _fn2, autocvar_cl_simpleitems_postfix)))
+                self.mdl = strzone(sprintf("%s%s.obj", _fn2, autocvar_cl_simpleitems_postfix));
             else
             {
                 self.draw = ItemDraw;
@@ -434,7 +434,7 @@ void Item_RespawnCountdown (void)
                                entity wi = get_weaponinfo(self.weapon);
                                if(wi)
                                {
-                                       name = wi.model2;
+                                       name = wi.wpmodel;
                                        rgb = '1 0 0';
                                }
                        }
@@ -588,7 +588,10 @@ float Item_GiveTo(entity item, entity player)
                        pickedup = TRUE;
                        for(i = WEP_FIRST; i <= WEP_LAST; ++i)
                        if(it & WepSet_FromWeapon(i))
+                       {
+                               W_DropEvent(WR_PICKUP, player, i, item);
                                W_GiveWeapon(player, i);
+                       }
                }
        }
 
@@ -596,7 +599,7 @@ float Item_GiveTo(entity item, entity player)
        {
                pickedup = TRUE;
                player.items |= it;
-               sprint (player, strcat("You got the ^2", item.netname, "\n"));
+               Send_Notification(NOTIF_ONE, player, MSG_INFO, INFO_ITEM_WEAPON_GOT, item.netname);
        }
 
        if (item.strength_finished)
@@ -647,6 +650,8 @@ void Item_Touch (void)
 
        if (!IS_PLAYER(other))
                return;
+       if (other.frozen)
+               return;
        if (other.deadflag)
                return;
        if (self.solid != SOLID_TRIGGER)
@@ -850,7 +855,7 @@ float commodity_pickupevalfunc(entity player, entity item)
                else if(wi.items & IT_PLASMA)
                        need_plasma = TRUE;
                else if(wi.items & IT_FUEL)
-                       need_cells = TRUE;
+                       need_fuel = TRUE;
        }
 
        // TODO: figure out if the player even has the weapon this ammo is for?
@@ -1385,10 +1390,7 @@ void spawnfunc_target_items (void)
                else
                {
                        error("invalid spawnflags");
-#ifdef GMQCC
-                       itemprefix = string_null;
-                       valueprefix = string_null;
-#endif
+                       itemprefix = valueprefix = string_null;
                }
 
                self.netname = "";
@@ -1453,8 +1455,6 @@ void spawnfunc_item_fuel_regen(void)
 
 void spawnfunc_item_jetpack(void)
 {
-       if(g_grappling_hook)
-               return; // sorry, but these two can't coexist (same button); spawn fuel instead
        if(!self.ammo_fuel)
                self.ammo_fuel = g_pickup_fuel_jetpack;
        if(start_items & IT_JETPACK)