]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add g_buffs_randomize_teamplay setting (on by default) to control whether buffs are...
authorMario <mario.mario@y7mail.com>
Mon, 13 Jan 2020 16:49:20 +0000 (02:49 +1000)
committerMario <mario.mario@y7mail.com>
Mon, 13 Jan 2020 16:49:20 +0000 (02:49 +1000)
mutators.cfg
qcsrc/common/mutators/mutator/buffs/sv_buffs.qc
qcsrc/common/mutators/mutator/buffs/sv_buffs.qh
qcsrc/server/g_world.qc

index 14289d8c8514146d75cf75f0c7e06cc0e0f60418..b6ad3468e0be9708d071c1abdb581e3175aa25ed 100644 (file)
@@ -309,7 +309,8 @@ set g_buffs_effects 1 "show particle effects from carried buffs"
 set g_buffs_waypoint_distance 1024 "maximum distance at which buff waypoint can be seen from item"
 set g_buffs_pickup_anyway 0 "instantly respawn the buff when it is picked up, instead of waiting for the player to drop it"
 set g_buffs_pickup_delay 0.7 "cooldown before player can pick up another buff after dropping one"
-set g_buffs_randomize 1 "randomize buff type when player drops buff"
+set g_buffs_randomize 1 "randomize buff type when player drops the buff, only applies to teamplay gamemodes if g_buffs_randomize_teamplay is enabled"
+set g_buffs_randomize_teamplay 1 "in teamplay gamemodes, randomize buff type when player drops the buff, requires g_buffs_randomize"
 set g_buffs_random_lifetime 30 "re-spawn the buff again if it hasn't been touched after this time in seconds"
 set g_buffs_random_location 0 "randomize buff location on start and when reset"
 set g_buffs_random_location_attempts 10 "number of random locations a single buff will attempt to respawn at before giving up"
index 5789b6e4c4ca2e2a06cdf31168d6151db81685d0..f1a14916611f244ae9878afb0f19b3368dfeef5a 100644 (file)
@@ -272,7 +272,7 @@ void buff_Think(entity this)
        {
                buff_SetCooldown(this, autocvar_g_buffs_cooldown_respawn + frametime);
                this.owner = NULL;
-               if(autocvar_g_buffs_randomize)
+               if(autocvar_g_buffs_randomize && (!teamplay || autocvar_g_buffs_randomize_teamplay))
                        buff_NewType(this);
 
                if(autocvar_g_buffs_random_location || (this.spawnflags & 64))
@@ -316,7 +316,7 @@ void buff_Waypoint_Reset(entity this)
 
 void buff_Reset(entity this)
 {
-       if(autocvar_g_buffs_randomize)
+       if(autocvar_g_buffs_randomize && (!teamplay || autocvar_g_buffs_randomize_teamplay))
                buff_NewType(this);
        this.owner = NULL;
        buff_SetCooldown(this, autocvar_g_buffs_cooldown_activate);
index 671a524f9eea2132f773c333c35b06ee3d02431d..88efc94ebb298e7df9158a872a274abb22e14fce 100644 (file)
@@ -9,6 +9,7 @@ float autocvar_g_buffs_waypoint_distance;
 bool autocvar_g_buffs_pickup_anyway = false;
 float autocvar_g_buffs_pickup_delay = 0.7;
 bool autocvar_g_buffs_randomize;
+bool autocvar_g_buffs_randomize_teamplay = true;
 float autocvar_g_buffs_random_lifetime;
 bool autocvar_g_buffs_random_location;
 int autocvar_g_buffs_random_location_attempts;
index aed2d2ef52fdcf87c1d5165c9f1f2a6699836849..c3dc5be39f605369ca208c79ec61490d9bdda3cd 100644 (file)
@@ -330,6 +330,7 @@ void cvar_changes_init()
                BADCVAR("g_balance_kill_delay");
                BADCVAR("g_buffs_pickup_anyway");
                BADCVAR("g_buffs_randomize");
+               BADCVAR("g_buffs_randomize_teamplay");
                BADCVAR("g_campcheck_distance");
                BADCVAR("g_ca_point_leadlimit");
                BADCVAR("g_ca_point_limit");