From 3734c069c15d1d59caa0a0c40cf30d0144bdd6ed Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 15 Jan 2020 05:45:44 +1000 Subject: [PATCH] Add an option to disable flag waypoints in CTF on the server, useful for maps where the flag's location isn't represented accurately by them (e.g. warpzone heavy maps), also add an option to control the maximum view distance of flag waypoints, useful for large maps that have lots of flags --- gamemodes-server.cfg | 2 ++ qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index cd71ecec0..28b434dc2 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -247,6 +247,8 @@ set g_ctf_flag_return_dropped 100 "automatically return the flag to base if drop set g_ctf_flag_return_damage 0 "allow the flag to be damaged, reducing time needed to automatically return to base" set g_ctf_flag_return_damage_delay 0 "how much time the flag takes to automatically return to base if it falls into lava/slime/trigger hurt" set g_ctf_flag_return_when_unreachable 1 "automatically return the flag if it falls into lava/slime/trigger hurt" +set g_ctf_flag_waypoint 1 "show a waypoint at the flag for easy discovery and directions" +set g_ctf_flag_waypoint_maxdistance 0 "maximum distance from a flag from which their waypoint is shown, a value of 0 means no limit" set g_ctf_flagcarrier_auto_helpme_damage 100 "automatically place a helpme notification on flag carrier waypointsprite if they get hit and their health dips below this value" set g_ctf_flagcarrier_auto_helpme_time 2 "antispam time for the helpme notification" set g_ctf_flagcarrier_selfdamagefactor 1 diff --git a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc index aa05ea337..11bbaea6f 100644 --- a/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc +++ b/qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc @@ -48,6 +48,8 @@ bool autocvar_g_ctf_flag_return_when_unreachable; float autocvar_g_ctf_flag_return_damage; float autocvar_g_ctf_flag_return_damage_delay; float autocvar_g_ctf_flag_return_dropped; +bool autocvar_g_ctf_flag_waypoint = true; +float autocvar_g_ctf_flag_waypoint_maxdistance; float autocvar_g_ctf_flagcarrier_auto_helpme_damage; float autocvar_g_ctf_flagcarrier_auto_helpme_time; float autocvar_g_ctf_flagcarrier_selfdamagefactor; @@ -1224,10 +1226,14 @@ void ctf_DelayedFlagSetup(entity this) // called after a flag is placed on a map default: basename = WP_FlagBaseNeutral; break; } - entity wp = WaypointSprite_SpawnFixed(basename, this.origin + FLAG_WAYPOINT_OFFSET, this, wps_flagbase, RADARICON_FLAG); - wp.colormod = ((this.team) ? Team_ColorRGB(this.team) : '1 1 1'); - WaypointSprite_UpdateTeamRadar(this.wps_flagbase, RADARICON_FLAG, ((this.team) ? colormapPaletteColor(this.team - 1, false) : '1 1 1')); - setcefc(wp, ctf_FlagBase_Customize); + if(autocvar_g_ctf_flag_waypoint) + { + entity wp = WaypointSprite_SpawnFixed(basename, this.origin + FLAG_WAYPOINT_OFFSET, this, wps_flagbase, RADARICON_FLAG); + wp.colormod = ((this.team) ? Team_ColorRGB(this.team) : '1 1 1'); + wp.fade_rate = autocvar_g_ctf_flag_waypoint_maxdistance; + WaypointSprite_UpdateTeamRadar(this.wps_flagbase, RADARICON_FLAG, ((this.team) ? colormapPaletteColor(this.team - 1, false) : '1 1 1')); + setcefc(wp, ctf_FlagBase_Customize); + } // captureshield setup ctf_CaptureShield_Spawn(this); -- 2.39.2