]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Added cvar for default loot lifetime and using it for dropped powerups 943/head
authorz411 <z411@omaera.org>
Thu, 2 Dec 2021 20:45:56 +0000 (17:45 -0300)
committerz411 <z411@omaera.org>
Thu, 2 Dec 2021 20:45:56 +0000 (17:45 -0300)
qcsrc/common/mutators/mutator/powerups/sv_powerups.qc
qcsrc/common/mutators/mutator/powerups/sv_powerups.qh
qcsrc/server/items/items.qc
qcsrc/server/items/items.qh
qcsrc/server/world.qc
xonotic-server.cfg

index f1326c97cfd52fee9146cb6ab85e434a8cf4b8c3..e7bbeeb69c2176048a2820e2349ca6b157a1c7d6 100644 (file)
@@ -112,7 +112,7 @@ void powerups_DropItem(entity this, StatusEffects effect)
 
        // If the timer is frozen, the item will stay on the floor for 20 secs (same as weapons),
        // otherwise it'll disappear after the timer runs out.
-       float time_to_live = (autocvar_g_powerups_drop_ondeath == 2 ? autocvar_g_powerups_drop_expire_time : timeleft);
+       float time_to_live = (autocvar_g_powerups_drop_ondeath == 2 ? autocvar_g_items_dropped_lifetime : timeleft);
 
        // TODO: items cannot hold their "item field" yet, so we need to list all the powerups here!
        switch(item)
index cd30dfecad73f1ce4d3d1b93fb342ead513a9fab..b7f3b8e40d65d9218f6f4483f2505309eef471de 100644 (file)
@@ -6,7 +6,6 @@
 
 int autocvar_g_powerups;
 int autocvar_g_powerups_drop_ondeath;
-float autocvar_g_powerups_drop_expire_time;
 bool autocvar_g_powerups_stack;
 
 REGISTER_MUTATOR(powerups, true);
index db9b3fece9609190313bf71a0693cf062ff8212d..c4e2353d8badee2ae5099f56e964cf1d7280cc6f 100644 (file)
@@ -981,7 +981,7 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default
 
                // Savage: remove thrown items after a certain period of time ("garbage collection")
                setthink(this, RemoveItem);
-               this.nextthink = time + 20;
+               this.nextthink = time + autocvar_g_items_dropped_lifetime;
 
                this.takedamage = DAMAGE_YES;
                this.event_damage = Item_Damage;
index ff2d138437658ed1e941f2c06dc5f0b10eb15a33..1515a526745e857c912328cd825f20c029cc185c 100644 (file)
@@ -6,6 +6,7 @@ float autocvar_g_balance_superweapons_time;
 bool autocvar_g_fullbrightitems;
 float autocvar_g_items_mindist;
 float autocvar_g_items_maxdist;
+float autocvar_g_items_dropped_lifetime;
 int autocvar_g_pickup_items;
 bool autocvar_g_nodepthtestitems;
 #define autocvar_g_weapon_stay cvar("g_weapon_stay")
index 043c5d8d23e153fdd67f4f1fd85b8b22a8fc9e13..8c0382d33fe406e5dc90320bb6219e4cb6140bad 100644 (file)
@@ -461,8 +461,7 @@ void cvar_changes_init()
                BADCVAR("g_physics_clientselect");
                BADCVAR("g_pinata");
                BADCVAR("g_powerups");
-               BADCVAR("g_powerups_dropondeath");
-               BADCVAR("g_powerups_dropondeath_ttl");
+               BADCVAR("g_powerups_drop_ondeath");
                BADCVAR("g_player_brightness");
                BADCVAR("g_rocket_flying");
                BADCVAR("g_rocket_flying_disabledelays");
index 7234e81af0876bb9606b804a6a2f8434fc052bd7..45266e8199f35a4f8d0f4153f37009c24c56ca16 100644 (file)
@@ -199,7 +199,6 @@ set g_weapon_stay 0 "1: ghost weapons can be picked up but give no ammo, thrown
 set g_weapon_throwable 1 "if set to 1, weapons can be dropped"
 set g_powerups -1 "if set to 0 no powerups will spawn, if 1 they will spawn in all game modes, -1 is game mode default"
 set g_powerups_drop_ondeath 0 "players will drop their powerups on death (1 = timer continues, 2 = timer freezes until picked up)"
-set g_powerups_drop_expire_time 25 "seconds before a dropped powerup disappears if its timer is frozen"
 set g_powerups_stack 0 "enables stacking of powerup timers when picking up a powerup you already have; otherwise timer is reset to the time granted by the item, if greater than the time you currently have"
 set g_powerups_strength 1 "allow strength powerups to spawn"
 set g_powerups_shield 1 "allow shield powerups to spawn"
@@ -233,6 +232,7 @@ set g_maplist_sizes_count_bots 1 "include the number of bots currently in the se
 
 set g_items_mindist 4000 "starting distance for the fading of items"
 set g_items_maxdist 4500 "maximum distance at which an item can be viewed, after which it will be invisible"
+set g_items_dropped_lifetime 20 "default lifetime for dropped items unless explicitly overriden (ie. flags)"
 
 set g_grab_range 200 "distance at which dragable objects can be grabbed"