]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
powerups_dropondeath: Make time to live configurable
authorz411 <z411@omaera.org>
Wed, 24 Nov 2021 17:21:07 +0000 (14:21 -0300)
committerz411 <z411@omaera.org>
Wed, 24 Nov 2021 17:21:58 +0000 (14:21 -0300)
qcsrc/common/mutators/mutator/powerups/sv_powerups.qc
qcsrc/common/mutators/mutator/powerups/sv_powerups.qh
qcsrc/server/world.qc
xonotic-server.cfg

index a4b24af13d514fea42db903797163258927b44e1..7bf005f91248ce9661f22b0fa5eb164b5d03bb12 100644 (file)
@@ -94,7 +94,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_dropondeath == 2 ? 20 : timeleft);
+       float time_to_live = (autocvar_g_powerups_dropondeath == 2 ? autocvar_g_powerups_dropondeath_ttl : timeleft);
 
        // TODO: items cannot hold their "item field" yet, so we need to list all the powerups here!
        switch(item)
index c9e7282b5efbcebbc6cd64f1c932a1dedb61cd45..eab884e577a06b134263a94c116b9e636f46eefd 100644 (file)
@@ -6,6 +6,7 @@
 
 int autocvar_g_powerups;
 int autocvar_g_powerups_dropondeath;
+int autocvar_g_powerups_dropondeath_ttl;
 bool autocvar_g_powerups_stack;
 
 REGISTER_MUTATOR(powerups, true);
index ee8bdbddeb48e08a10da415965f8633415f46014..043c5d8d23e153fdd67f4f1fd85b8b22a8fc9e13 100644 (file)
@@ -462,6 +462,7 @@ void cvar_changes_init()
                BADCVAR("g_pinata");
                BADCVAR("g_powerups");
                BADCVAR("g_powerups_dropondeath");
+               BADCVAR("g_powerups_dropondeath_ttl");
                BADCVAR("g_player_brightness");
                BADCVAR("g_rocket_flying");
                BADCVAR("g_rocket_flying_disabledelays");
index 54e9c8be1e55bd56f759f0c3265a9ae58f752505..2500862223de72b9a8c8b928ac857e93a1db7adf 100644 (file)
@@ -198,7 +198,8 @@ set g_shootfromfixedorigin "" "if set to a string like 0 y z, the gun is moved t
 set g_weapon_stay 0 "1: ghost weapons can be picked up but give no ammo, thrown guns have ammo 2: ghost weapons can be picked up and refill ammo to one pickup size, thrown guns have no ammo (to prevent infinite ammo abuse)"
 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_dropondeath 0 "whether or not held powerups should be droppd when the player dies (1 = timer keeps running, 2 = timer freezes until picked up)"
+set g_powerups_dropondeath 0 "players will drop their powerups on death (1 = timer continues, 2 = timer freezes until picked up)"
+set g_powerups_dropondeath_ttl 20 "seconds before a dropped powerup disappears if dropondeath is set to 2"
 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"