From 1b025fc0d283f6ea0f618a1a355eb0e2626da202 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Sun, 31 May 2020 13:42:07 +0000 Subject: [PATCH] Allow buff waypoint sprites to be disabled --- mutators.cfg | 2 +- qcsrc/common/mutators/mutator/buffs/sv_buffs.qc | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mutators.cfg b/mutators.cfg index 2d5289378..8ea8dc22b 100644 --- a/mutators.cfg +++ b/mutators.cfg @@ -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" diff --git a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc index 82c9a595a..fcbb399cb 100644 --- a/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc +++ b/qcsrc/common/mutators/mutator/buffs/sv_buffs.qc @@ -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)); -- 2.39.2