]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Allow buff waypoint sprites to be disabled
authorbones_was_here <bones_was_here@yahoo.com.au>
Sun, 31 May 2020 13:42:07 +0000 (13:42 +0000)
committerMario <mario.mario@y7mail.com>
Sun, 31 May 2020 13:42:07 +0000 (13:42 +0000)
mutators.cfg
qcsrc/common/mutators/mutator/buffs/sv_buffs.qc

index 2d52893786d5d7d02c9e4969f4bc300fb8ddcaa8..8ea8dc22b1ae0b48a06f0e328d69664b31f711d8 100644 (file)
@@ -309,7 +309,7 @@ set g_new_toys_use_pickupsound 0 "play the 'new toys, new toys!' roflsound when
 seta cl_buffs_autoreplace 1 "automatically drop current buff when picking up another"
 set g_buffs -1 "enable buffs (requires buff items or powerups on the map)"
 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_waypoint_distance 1024 "maximum distance from item at which buff waypoint can be seen, 0 disables buff waypoints"
 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 the buff, only applies to teamplay gamemodes if g_buffs_randomize_teamplay is enabled"
index 82c9a595a64455255c783a84a4ca87f27b7cb45e..fcbb399cbedee8e8e91e55a703f40d0ff9a29e1d 100644 (file)
@@ -92,6 +92,8 @@ bool buff_Waypoint_visible_for_player(entity this, entity player, entity view)
 
 void buff_Waypoint_Spawn(entity e)
 {
+       if(autocvar_g_buffs_waypoint_distance <= 0) return;
+
        entity buff = buff_FirstFromFlags(STAT(BUFFS, e));
        entity wp = WaypointSprite_Spawn(WP_Buff, 0, autocvar_g_buffs_waypoint_distance, e, '0 0 1' * e.maxs.z, NULL, e.team, e, buff_waypoint, true, RADARICON_Buff);
        wp.wp_extra = buff.m_id;
@@ -106,7 +108,9 @@ void buff_SetCooldown(entity this, float cd)
        if(!this.buff_waypoint)
                buff_Waypoint_Spawn(this);
 
-       WaypointSprite_UpdateBuildFinished(this.buff_waypoint, time + cd);
+       if(this.buff_waypoint)
+               WaypointSprite_UpdateBuildFinished(this.buff_waypoint, time + cd);
+
        this.buff_activetime = cd;
        this.buff_active = !cd;
 }
@@ -238,6 +242,9 @@ void buff_NewType(entity ent)
 
 void buff_Think(entity this)
 {
+       if(this.buff_waypoint && autocvar_g_buffs_waypoint_distance <= 0)
+               WaypointSprite_Kill(this.buff_waypoint);
+
        if(STAT(BUFFS, this) != this.oldbuffs)
        {
                entity buff = buff_FirstFromFlags(STAT(BUFFS, this));