]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/t_items.qc
fix powerup rules for LMS and CA
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / t_items.qc
index ba0cb8bb3e00c9873fcad5ada9cede5d344a61d8..9a8ac71239ba807cfe8019022aae7d7473a9e605 100644 (file)
@@ -1,3 +1,40 @@
+float have_pickup_item(void)
+{
+       // minstagib: only allow filtered items
+       if(g_minstagib)
+               if(self.classname != "minstagib")
+                       return FALSE;
+
+       if(self.items == IT_STRENGTH || self.items == IT_INVINCIBLE)
+       {
+               if(autocvar_g_powerups > 0)
+                       return TRUE;
+               if(autocvar_g_powerups == 0)
+                       return FALSE;
+               if(g_lms)
+                       return FALSE;
+               if(g_ca)
+                       return FALSE;
+               if(g_arena)
+                       return FALSE;
+       }
+       else
+       {
+               if(autocvar_g_pickup_items > 0)
+                       return TRUE;
+               if(autocvar_g_pickup_items == 0)
+                       return FALSE;
+               if(g_lms)
+                       return FALSE;
+               if(g_ca)
+                       return FALSE;
+               if(g_weaponarena)
+                       if((self.weapons & WEPBIT_ALL) || (self.items & IT_AMMO))
+                               return FALSE;
+       }
+       return TRUE;
+}
+
 #define ITEM_RESPAWN_TICKS 10
 
 #define ITEM_RESPAWNTIME(i)         ((i).respawntime + crandom() * (i).respawntimejitter)
@@ -57,7 +94,7 @@ float Item_Customize()
        {
                if(g_ghost_items)
                {
-                       self.colormod = stov(cvar_string("g_ghost_items_color"));
+                       self.colormod = stov(autocvar_g_ghost_items_color);
                        self.glowmod = self.colormod;
                        self.alpha = g_ghost_items;
                        return TRUE;
@@ -96,7 +133,7 @@ void Item_Show (entity e, float mode)
        }
        else if((e.flags & FL_WEAPON) && (g_weapon_stay == 3))
        {
-               // make the item translucent green and not touchable
+               // make the item translucent and not touchable
                e.model = e.mdl;
                e.solid = SOLID_TRIGGER; // can STILL be picked up!
                e.colormod = '0 0 0';
@@ -108,10 +145,10 @@ void Item_Show (entity e, float mode)
        }
        else if(g_ghost_items)
        {
-               // make the item translucent green and not touchable
+               // make the item translucent and not touchable
                e.model = e.mdl;
                e.solid = SOLID_NOT;
-               e.colormod = stov(cvar_string("g_ghost_items_color"));
+               e.colormod = stov(autocvar_g_ghost_items_color);
                e.glowmod = e.colormod;
                e.alpha = g_ghost_items;
                e.customizeentityforclient = func_null;
@@ -123,7 +160,7 @@ void Item_Show (entity e, float mode)
                // hide the item completely
                e.model = string_null;
                e.solid = SOLID_NOT;
-               e.colormod = stov(cvar_string("g_ghost_items_color"));
+               e.colormod = '0 0 0';
                e.glowmod = e.colormod;
                e.alpha = 0;
                e.customizeentityforclient = func_null;
@@ -133,9 +170,9 @@ void Item_Show (entity e, float mode)
 
        if (e.strength_finished || e.invincible_finished)
                e.effects |= EF_ADDITIVE | EF_FULLBRIGHT;
-       if (cvar("g_nodepthtestitems"))
+       if (autocvar_g_nodepthtestitems)
                e.effects |= EF_NODEPTHTEST;
-       if (cvar("g_fullbrightitems"))
+       if (autocvar_g_fullbrightitems)
                e.effects |= EF_FULLBRIGHT;
 
        // relink entity (because solid may have changed)
@@ -146,11 +183,11 @@ void Item_Respawn (void)
 {
        Item_Show(self, 1);
        if(!g_minstagib && self.items == IT_STRENGTH)
-               sound (self, CHAN_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM);   // play respawn sound
+               sound (self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM);     // play respawn sound
        else if(!g_minstagib && self.items == IT_INVINCIBLE)
-               sound (self, CHAN_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTN_NORM);     // play respawn sound
+               sound (self, CH_TRIGGER, "misc/shield_respawn.wav", VOL_BASE, ATTN_NORM);       // play respawn sound
        else
-               sound (self, CHAN_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTN_NORM);        // play respawn sound
+               sound (self, CH_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTN_NORM);  // play respawn sound
        setorigin (self, self.origin);
 
        //pointparticles(particleeffectnum("item_respawn"), self.origin + self.mins_z * '0 0 1' + '0 0 48', '0 0 0', 1);
@@ -198,16 +235,12 @@ void Item_RespawnCountdown (void)
                        }
                        if(name)
                        {
-                               WaypointSprite_Spawn(name, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE);
+                               WaypointSprite_Spawn(name, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE, RADARICON_POWERUP, rgb);
                                if(self.waypointsprite_attached)
-                               {
-                                       WaypointSprite_UpdateTeamRadar(self.waypointsprite_attached, RADARICON_POWERUP, rgb);
-                                       //WaypointSprite_UpdateMaxHealth(self.waypointsprite_attached, ITEM_RESPAWN_TICKS + 1);
                                        WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, time + ITEM_RESPAWN_TICKS);
-                               }
                        }
                }
-               sound (self, CHAN_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTN_NORM);       // play respawn sound
+               sound (self, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTN_NORM); // play respawn sound
                if(self.waypointsprite_attached)
                {
                        WaypointSprite_Ping(self.waypointsprite_attached);
@@ -268,8 +301,8 @@ float Item_GiveTo(entity item, entity player)
                        if (player.ammo_fuel < g_pickup_fuel_max)
                        {
                                pickedup = TRUE;
-                               player.ammo_fuel = min(player.ammo_fuel + item.ammo_fuel, g_pickup_fuel_max);
-                               player.pauserotfuel_finished = max(player.pauserotfuel_finished, time + cvar("g_balance_pause_fuel_rot"));
+                               player.ammo_fuel = bound(player.ammo_fuel, g_pickup_fuel_max, player.ammo_fuel + item.ammo_fuel);
+                               player.pauserotfuel_finished = max(player.pauserotfuel_finished, time + autocvar_g_balance_pause_fuel_rot);
                        }
                        if((it = (item.items - (item.items & player.items)) & IT_PICKUPMASK))
                        {
@@ -283,7 +316,6 @@ float Item_GiveTo(entity item, entity player)
                        {
                                pickedup = TRUE;
                                // play some cool sounds ;)
-                               centerprint(player, "\n");
                                if (clienttype(player) == CLIENTTYPE_REAL)
                                {
                                        if(player.health <= 5)
@@ -298,7 +330,7 @@ float Item_GiveTo(entity item, entity player)
                                if (item.weapons & WEPBIT_MINSTANEX)
                                        W_GiveWeapon (player, WEP_MINSTANEX, item.netname);
                                if (item.ammo_cells)
-                                       player.ammo_cells = min (player.ammo_cells + cvar("g_minstagib_ammo_drop"), 999);
+                                       player.ammo_cells = bound(player.ammo_cells, 999, player.ammo_cells + autocvar_g_minstagib_ammo_drop);
                                player.health = 100;
                        }
 
@@ -308,7 +340,7 @@ float Item_GiveTo(entity item, entity player)
                                pickedup = TRUE;
                                // sound not available
                                // AnnounceTo(player, "_lives");
-                               player.armorvalue = min(player.armorvalue + cvar("g_minstagib_extralives"), 999);
+                               player.armorvalue = bound(player.armorvalue, 999, player.armorvalue + autocvar_g_minstagib_extralives);
                                sprint(player, "^3You picked up some extra lives\n");
                        }
 
@@ -318,7 +350,7 @@ float Item_GiveTo(entity item, entity player)
                                pickedup = TRUE;
                                // sound not available
                                // AnnounceTo(player, "invisible");
-                               player.strength_finished = max(player.strength_finished, time) + cvar("g_balance_powerup_strength_time");
+                               player.strength_finished = max(player.strength_finished, time) + autocvar_g_balance_powerup_strength_time;
                        }
 
                        // speed powerup
@@ -327,15 +359,7 @@ float Item_GiveTo(entity item, entity player)
                                pickedup = TRUE;
                                // sound not available
                                // AnnounceTo(player, "speed");
-                               player.invincible_finished = max(player.invincible_finished, time) + cvar("g_balance_powerup_strength_time");
-                       }
-
-                       if (item.ammo_fuel)
-                       if (player.ammo_fuel < g_pickup_fuel_max) 
-                       {
-                               pickedup = TRUE;
-                               player.ammo_fuel = min(player.ammo_fuel + item.ammo_fuel, g_pickup_fuel_max);
-                               player.pauserotfuel_finished = max(player.pauserotfuel_finished, time + cvar("g_balance_pause_fuel_rot"));
+                               player.invincible_finished = max(player.invincible_finished, time) + autocvar_g_balance_powerup_strength_time;
                        }
                }
        }
@@ -373,37 +397,37 @@ float Item_GiveTo(entity item, entity player)
                        if ((player.ammo_shells < g_pickup_shells_max) || item.pickup_anyway)
                        {
                                pickedup = TRUE;
-                               player.ammo_shells = min (player.ammo_shells + item.ammo_shells, g_pickup_shells_max);
+                               player.ammo_shells = bound(player.ammo_shells, g_pickup_shells_max, player.ammo_shells + item.ammo_shells);
                        }
                        if (item.ammo_nails)
                        if ((player.ammo_nails < g_pickup_nails_max) || item.pickup_anyway)
                        {
                                pickedup = TRUE;
-                               player.ammo_nails = min (player.ammo_nails + item.ammo_nails, g_pickup_nails_max);
+                               player.ammo_nails = bound(player.ammo_nails, g_pickup_nails_max, player.ammo_nails + item.ammo_nails);
                        }
                        if (item.ammo_rockets)
                        if ((player.ammo_rockets < g_pickup_rockets_max) || item.pickup_anyway)
                        {
                                pickedup = TRUE;
-                               player.ammo_rockets = min (player.ammo_rockets + item.ammo_rockets, g_pickup_rockets_max);
+                               player.ammo_rockets = bound(player.ammo_rockets, g_pickup_rockets_max, player.ammo_rockets + item.ammo_rockets);
                        }
                        if (item.ammo_cells)
                        if ((player.ammo_cells < g_pickup_cells_max) || item.pickup_anyway)
                        {
                                pickedup = TRUE;
-                               player.ammo_cells = min (player.ammo_cells + item.ammo_cells, g_pickup_cells_max);
+                               player.ammo_cells = bound(player.ammo_cells, g_pickup_cells_max, player.ammo_cells + item.ammo_cells);
                        }
                        if (item.ammo_fuel)
                        if ((player.ammo_fuel < g_pickup_fuel_max) || item.pickup_anyway)
                        {
                                pickedup = TRUE;
-                               player.ammo_fuel = min(player.ammo_fuel + item.ammo_fuel, g_pickup_fuel_max);
-                               player.pauserotfuel_finished = max(player.pauserotfuel_finished, time + cvar("g_balance_pause_fuel_rot"));
+                               player.ammo_fuel = bound(player.ammo_fuel, g_pickup_fuel_max, player.ammo_fuel + item.ammo_fuel);
+                               player.pauserotfuel_finished = max(player.pauserotfuel_finished, time + autocvar_g_balance_pause_fuel_rot);
                        }
                }
 
                if (item.flags & FL_WEAPON)
-               if ((it = item.weapons - (item.weapons & player.weapons)) || g_pickup_weapons_anyway)
+                       if ((it = item.weapons - (item.weapons & player.weapons)) || (g_pickup_weapons_anyway && g_weapon_stay == 0))
                {
                        pickedup = TRUE;
                        for(i = WEP_FIRST; i <= WEP_LAST; ++i)
@@ -426,27 +450,27 @@ float Item_GiveTo(entity item, entity player)
                        if (item.strength_finished)
                        {
                                pickedup = TRUE;
-                               player.strength_finished = max(player.strength_finished, time) + cvar("g_balance_powerup_strength_time");
+                               player.strength_finished = max(player.strength_finished, time) + autocvar_g_balance_powerup_strength_time;
                        }
                        if (item.invincible_finished)
                        {
                                pickedup = TRUE;
-                               player.invincible_finished = max(player.invincible_finished, time) + cvar("g_balance_powerup_invincible_time");
+                               player.invincible_finished = max(player.invincible_finished, time) + autocvar_g_balance_powerup_invincible_time;
                        }
 
                        if (item.health)
                        if ((player.health < item.max_health) || item.pickup_anyway)
                        {
                                pickedup = TRUE;
-                               player.health = min(player.health + item.health, item.max_health);
-                               player.pauserothealth_finished = max(player.pauserothealth_finished, time + cvar("g_balance_pause_health_rot"));
+                               player.health = bound(player.health, item.max_health, player.health + item.health);
+                               player.pauserothealth_finished = max(player.pauserothealth_finished, time + autocvar_g_balance_pause_health_rot);
                        }
                        if (item.armorvalue)
                        if ((player.armorvalue < item.max_armorvalue) || item.pickup_anyway)
                        {
                                pickedup = TRUE;
-                               player.armorvalue = min(player.armorvalue + item.armorvalue, item.max_armorvalue);
-                               player.pauserotarmor_finished = max(player.pauserotarmor_finished, time + cvar("g_balance_pause_armor_rot"));
+                               player.armorvalue = bound(player.armorvalue, item.max_armorvalue, player.armorvalue + item.armorvalue);
+                               player.pauserotarmor_finished = max(player.pauserotarmor_finished, time + autocvar_g_balance_pause_armor_rot);
                        }
                }
        }
@@ -459,7 +483,7 @@ float Item_GiveTo(entity item, entity player)
        if (!pickedup)
                return 0;
 
-       sound (player, CHAN_AUTO, item.item_pickupsound, VOL_BASE, ATTN_NORM);
+       sound (player, CH_TRIGGER, item.item_pickupsound, VOL_BASE, ATTN_NORM);
        if (_switchweapon)
                if (player.switchweapon != w_getbestweapon(player))
                        W_SwitchWeapon_Force(player, w_getbestweapon(player));
@@ -489,6 +513,8 @@ void Item_Touch (void)
        if(!Item_GiveTo(self, other))
                return;
 
+       other.last_pickup = time;
+
        pointparticles(particleeffectnum("item_pickup"), self.origin, '0 0 0', 1);
 
        if (self.classname == "droppedweapon")
@@ -570,7 +596,7 @@ void RemoveItem(void)
 // pickup evaluation functions
 // these functions decide how desirable an item is to the bots
 
-float generic_pickupevalfunc(entity player, entity item) {return item.bot_pickupbasevalue;};
+float generic_pickupevalfunc(entity player, entity item) {return item.bot_pickupbasevalue;}
 
 float weapon_pickupevalfunc(entity player, entity item)
 {
@@ -596,7 +622,7 @@ float weapon_pickupevalfunc(entity player, entity item)
        // If custom weapon priorities for bots is enabled rate most wanted weapons higher
        if( bot_custom_weapon && c )
        {
-               for(i = WEP_FIRST; i < WEP_LAST ; ++i)
+               for(i = WEP_FIRST; i <= WEP_LAST ; ++i)
                {
                        // Find weapon
                        if( (get_weaponinfo(i)).weapons & item.weapons  != item.weapons )
@@ -627,7 +653,7 @@ float weapon_pickupevalfunc(entity player, entity item)
        }
 
        return item.bot_pickupbasevalue * c;
-};
+}
 
 float commodity_pickupevalfunc(entity player, entity item)
 {
@@ -636,7 +662,7 @@ float commodity_pickupevalfunc(entity player, entity item)
        c = 0;
 
        // Detect needed ammo
-       for(i = WEP_FIRST; i < WEP_LAST ; ++i)
+       for(i = WEP_FIRST; i <= WEP_LAST ; ++i)
        {
                wi = get_weaponinfo(i);
 
@@ -680,7 +706,7 @@ float commodity_pickupevalfunc(entity player, entity item)
                c = c + max(0, 1 - player.health / item.max_health);
 
        return item.bot_pickupbasevalue * c;
-};
+}
 
 
 .float is_item;
@@ -718,6 +744,13 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                        return;
                }
 
+               if(!have_pickup_item())
+               {
+                       startitem_failed = TRUE;
+                       remove (self);
+                       return;
+               }
+
                self.reset = Item_Reset;
                // it's a level item
                if(self.spawnflags & 1)
@@ -741,36 +774,6 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                        waypoint_spawnforitem(self);
                }
 
-               if(teams_matter)
-               {
-                       if(self.notteam)
-                       {
-                               print("removed non-teamplay ", self.classname, "\n");
-                               startitem_failed = TRUE;
-                               remove (self);
-                               return;
-                       }
-               }
-               else
-               {
-                       if(self.notfree)
-                       {
-                               print("removed non-FFA ", self.classname, "\n");
-                               startitem_failed = TRUE;
-                               remove (self);
-                               return;
-                       }
-               }
-
-               if(self.notq3a)
-               {
-                       // We aren't TA or something like that, so we keep the Q3A entities
-                       print("removed non-Q3A ", self.classname, "\n");
-                       startitem_failed = TRUE;
-                       remove (self);
-                       return;
-               }
-
                /*
                 * can't do it that way, as it would break maps
                 * TODO make a target_give like entity another way, that perhaps has
@@ -785,7 +788,7 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                }
                */
 
-               if(cvar("spawn_debug") >= 2)
+               if(autocvar_spawn_debug >= 2)
                {
                        entity otheritem;
                        for(otheritem = findradius(self.origin, 3); otheritem; otheritem = otheritem.chain)
@@ -800,35 +803,6 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
                        self.is_item = TRUE;
                }
 
-               if(g_lms || g_ca)
-               {
-                       startitem_failed = TRUE;
-                       remove(self);
-                       return;
-               }
-               else if (g_weaponarena && ((weaponid & WEPBIT_ALL) || (itemid & IT_AMMO)))
-               {
-                       startitem_failed = TRUE;
-                       remove(self);
-                       return;
-               }
-               else if (g_minstagib)
-               {
-                       // don't remove dropped items and powerups
-                       if (self.classname != "minstagib")
-                       {
-                               startitem_failed = TRUE;
-                               remove (self);
-                               return;
-                       }
-               }
-               else if (!cvar("g_pickup_items") && itemid != IT_STRENGTH && itemid != IT_INVINCIBLE && itemid != IT_HEALTH)
-               {
-                       startitem_failed = TRUE;
-                       remove (self);
-                       return;
-               }
-
                weaponsInMap |= weaponid;
 
                precache_model (itemmodel);
@@ -896,7 +870,7 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
  */
 void minstagib_items (float itemid)
 {
-       local float rnd;
+       float rnd;
        self.classname = "minstagib";
 
        // replace rocket launchers and nex guns with ammo cells
@@ -1082,7 +1056,7 @@ void weapon_defaultspawnfunc(float wpn)
 
 void spawnfunc_weapon_shotgun (void);
 void spawnfunc_weapon_uzi (void) {
-       if(q3acompat_machineshotgunswap)
+       if(autocvar_sv_q3acompat_machineshotgunswap)
        if(self.classname != "droppedweapon")
        {
                weapon_defaultspawnfunc(WEP_SHOTGUN);
@@ -1092,7 +1066,7 @@ void spawnfunc_weapon_uzi (void) {
 }
 
 void spawnfunc_weapon_shotgun (void) {
-       if(q3acompat_machineshotgunswap)
+       if(autocvar_sv_q3acompat_machineshotgunswap)
        if(self.classname != "droppedweapon")
        {
                weapon_defaultspawnfunc(WEP_UZI);
@@ -1148,7 +1122,7 @@ void spawnfunc_item_rockets (void) {
 void spawnfunc_item_shells (void);
 void spawnfunc_item_bullets (void) {
        if(!weaponswapping)
-       if(q3acompat_machineshotgunswap)
+       if(autocvar_sv_q3acompat_machineshotgunswap)
        if(self.classname != "droppedweapon")
        {
                weaponswapping = TRUE;
@@ -1174,7 +1148,7 @@ void spawnfunc_item_cells (void) {
 
 void spawnfunc_item_shells (void) {
        if(!weaponswapping)
-       if(q3acompat_machineshotgunswap)
+       if(autocvar_sv_q3acompat_machineshotgunswap)
        if(self.classname != "droppedweapon")
        {
                weaponswapping = TRUE;
@@ -1261,12 +1235,6 @@ void spawnfunc_item_health_large (void) {
 }
 
 void spawnfunc_item_health_mega (void) {
-       if(!cvar("g_powerup_superhealth"))
-               return;
-
-       if((g_arena || g_ca) && !cvar("g_arena_powerups"))
-               return;
-
        if(g_minstagib) {
                minstagib_items(IT_NAILS);
        } else {
@@ -1288,12 +1256,6 @@ void spawnfunc_item_health25() { spawnfunc_item_health_medium(); }
 void spawnfunc_item_health100() { spawnfunc_item_health_mega(); }
 
 void spawnfunc_item_strength (void) {
-       if(!cvar("g_powerup_strength"))
-               return;
-
-       if((g_arena || g_ca) && !cvar("g_arena_powerups"))
-               return;
-
        if(g_minstagib) {
                minstagib_items(IT_STRENGTH);
        } else {
@@ -1304,12 +1266,6 @@ void spawnfunc_item_strength (void) {
 }
 
 void spawnfunc_item_invincible (void) {
-       if(!cvar("g_powerup_shield"))
-               return;
-
-       if((g_arena || g_ca) && !cvar("g_arena_powerups"))
-               return;
-
        if(g_minstagib) {
                minstagib_items(IT_INVINCIBLE);
        } else {
@@ -1363,9 +1319,9 @@ void spawnfunc_target_items (void)
 
        self.use = target_items_use;
        if(!self.strength_finished)
-               self.strength_finished = cvar("g_balance_powerup_strength_time");
+               self.strength_finished = autocvar_g_balance_powerup_strength_time;
        if(!self.invincible_finished)
-               self.invincible_finished = cvar("g_balance_powerup_invincible_time");
+               self.invincible_finished = autocvar_g_balance_powerup_invincible_time;
 
        precache_sound("misc/itempickup.wav");
        precache_sound("misc/megahealth.wav");
@@ -1572,12 +1528,12 @@ void GiveSound(entity e, float v0, float v1, float t, string snd_incr, string sn
        if(v1 <= v0 - t)
        {
                if(snd_decr != "")
-                       sound (e, CHAN_AUTO, snd_decr, VOL_BASE, ATTN_NORM);
+                       sound (e, CH_TRIGGER, snd_decr, VOL_BASE, ATTN_NORM);
        }
        else if(v0 >= v0 + t)
        {
                if(snd_incr != "")
-                       sound (e, CHAN_AUTO, snd_incr, VOL_BASE, ATTN_NORM);
+                       sound (e, CH_TRIGGER, snd_incr, VOL_BASE, ATTN_NORM);
        }
 }
 
@@ -1758,9 +1714,9 @@ float GiveItems(entity e, float beginarg, float endarg)
        POSTGIVE_VALUE(e, ammo_cells, 0, "misc/itempickup.wav", string_null);
        POSTGIVE_VALUE(e, ammo_shells, 0, "misc/itempickup.wav", string_null);
        POSTGIVE_VALUE(e, ammo_rockets, 0, "misc/itempickup.wav", string_null);
-       POSTGIVE_VALUE_ROT(e, ammo_fuel, 1, pauserotfuel_finished, cvar("g_balance_pause_fuel_rot"), pauseregen_finished, cvar("g_balance_pause_fuel_regen"), "misc/itempickup.wav", string_null);
-       POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, cvar("g_balance_pause_armor_rot"), pauseregen_finished, cvar("g_balance_pause_health_regen"), "misc/armor25.wav", string_null);
-       POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, cvar("g_balance_pause_health_rot"), pauseregen_finished, cvar("g_balance_pause_health_regen"), "misc/megahealth.wav", string_null);
+       POSTGIVE_VALUE_ROT(e, ammo_fuel, 1, pauserotfuel_finished, autocvar_g_balance_pause_fuel_rot, pauseregen_finished, autocvar_g_balance_pause_fuel_regen, "misc/itempickup.wav", string_null);
+       POSTGIVE_VALUE_ROT(e, armorvalue, 1, pauserotarmor_finished, autocvar_g_balance_pause_armor_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/armor25.wav", string_null);
+       POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, "misc/megahealth.wav", string_null);
 
        if (g_minstagib)
        {