]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Powerup drops: Changed cvar names
authorz411 <z411@omaera.org>
Thu, 2 Dec 2021 18:42:04 +0000 (15:42 -0300)
committerz411 <z411@omaera.org>
Thu, 2 Dec 2021 18:42:04 +0000 (15:42 -0300)
qcsrc/common/mutators/mutator/powerups/sv_powerups.qc
qcsrc/common/mutators/mutator/powerups/sv_powerups.qh
xonotic-server.cfg

index 3356fe49ea588c0c823f7add1e716e8d9da4a08e..f1326c97cfd52fee9146cb6ab85e434a8cf4b8c3 100644 (file)
@@ -88,7 +88,7 @@ void powerups_DropItem_Think(entity this)
        }
        
        // Only needed to update if the timer of the powerup is running
-       if(autocvar_g_powerups_dropondeath == 1)
+       if(autocvar_g_powerups_drop_ondeath == 1)
                WaypointSprite_UpdateHealth(this.waypointsprite_attached, GetResource(this, RES_HEALTH));
        
        this.nextthink = time + 1;
@@ -108,11 +108,11 @@ void powerups_DropItem(entity this, StatusEffects effect)
        // If we want the timer to keep running, we enable expiring then use the exact time the powerup will finish at.
        // If we want the timer to freeze, we disable expiring and we just use the time left of the powerup.
        // See Item_SetExpiring() below.
-       float finished = (autocvar_g_powerups_dropondeath == 2 ? timeleft : t);
+       float finished = (autocvar_g_powerups_drop_ondeath == 2 ? timeleft : t);
 
        // 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 ? autocvar_g_powerups_dropondeath_ttl : timeleft);
+       float time_to_live = (autocvar_g_powerups_drop_ondeath == 2 ? autocvar_g_powerups_drop_expire_time : timeleft);
 
        // TODO: items cannot hold their "item field" yet, so we need to list all the powerups here!
        switch(item)
@@ -124,7 +124,7 @@ void powerups_DropItem(entity this, StatusEffects effect)
        }
        Item_InitializeLoot(e, item.m_canonical_spawnfunc, this.origin + '0 0 32', randomvec() * 175 + '0 0 175', time_to_live);
 
-       if(autocvar_g_powerups_dropondeath != 2)
+       if(autocvar_g_powerups_drop_ondeath != 2)
                Item_SetExpiring(e, true);
        
        // Use health as time left to live
@@ -150,7 +150,7 @@ MUTATOR_HOOKFUNCTION(powerups, ItemTouched)
 
 MUTATOR_HOOKFUNCTION(powerups, PlayerDies)
 {
-       if(!autocvar_g_powerups_dropondeath)
+       if(!autocvar_g_powerups_drop_ondeath)
                return;
 
        entity frag_target = M_ARGV(2, entity);
index eab884e577a06b134263a94c116b9e636f46eefd..cd30dfecad73f1ce4d3d1b93fb342ead513a9fab 100644 (file)
@@ -5,8 +5,8 @@
 #include "powerups.qh"
 
 int autocvar_g_powerups;
-int autocvar_g_powerups_dropondeath;
-int autocvar_g_powerups_dropondeath_ttl;
+int autocvar_g_powerups_drop_ondeath;
+float autocvar_g_powerups_drop_expire_time;
 bool autocvar_g_powerups_stack;
 
 REGISTER_MUTATOR(powerups, true);
index 2500862223de72b9a8c8b928ac857e93a1db7adf..7234e81af0876bb9606b804a6a2f8434fc052bd7 100644 (file)
@@ -198,8 +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 "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_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"