]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/t_items.qc
Update the server side cvar, fix something
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / t_items.qc
index 45698f1b2b978eeec8a7ceab1ea11b9edde10dea..cb6700a2cfb60a3a5e2e289ff82761976dada93a 100644 (file)
@@ -277,8 +277,6 @@ float have_pickup_item(void)
                        return TRUE;
                if(autocvar_g_powerups == 0)
                        return FALSE;
-               if(g_lms)
-                       return FALSE;
                if(g_ca)
                        return FALSE;
                if(g_arena)
@@ -290,8 +288,6 @@ float have_pickup_item(void)
                        return TRUE;
                if(autocvar_g_pickup_items == 0)
                        return FALSE;
-               if(g_lms)
-                       return FALSE;
                if(g_ca)
                        return FALSE;
                if(g_weaponarena)
@@ -624,12 +620,12 @@ float Item_GiveTo(entity item, entity player)
                WEPSET_COPY_AE(it, item);
                WEPSET_ANDNOT_AE(it, player);
 
-               if (!WEPSET_EMPTY_A(it) || (item.spawnshieldtime && self.pickup_anyway))
+               if (!WEPSET_EMPTY_A(it) || (item.spawnshieldtime && item.pickup_anyway))
                {
-               pickedup = TRUE;
-               for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+                       pickedup = TRUE;
+                       for(i = WEP_FIRST; i <= WEP_LAST; ++i)
                        if(WEPSET_CONTAINS_AW(it, i))
-                       W_GiveWeapon(player, i);
+                               W_GiveWeapon(player, i);
                }
        }
 
@@ -655,16 +651,13 @@ float Item_GiveTo(entity item, entity player)
                pickedup = TRUE;
                player.superweapons_finished = max(player.superweapons_finished, time) + item.superweapons_finished;
        }
+       if (item.max_health)
+       {
+               pickedup = TRUE;
+               // extra life powerup handled by mutators
+       }
 
 :skip
-
-       other = player;
-       giveitem = item;
-       player_wswitch = _switchweapon;
-       player_pickedup = pickedup;
-       MUTATOR_CALLHOOK(Item_GiveTo);
-       _switchweapon = player_wswitch;
-       pickedup = player_pickedup;
        
        // always eat teamed entities
        if(item.team)
@@ -694,7 +687,7 @@ void Item_Touch (void)
                }
        }
 
-       if (other.classname != "player")
+       if not(IS_PLAYER(other))
                return;
        if (other.deadflag)
                return;
@@ -1497,7 +1490,7 @@ void target_items_use (void)
                return;
        }
 
-       if(activator.classname != "player")
+       if not(IS_PLAYER(activator))
                return;
        if(activator.deadflag != DEAD_NO)
                return;