]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an option to disable flag waypoints in CTF on the server, useful for maps where...
authorMario <mario.mario@y7mail.com>
Tue, 14 Jan 2020 19:45:44 +0000 (05:45 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 14 Jan 2020 19:45:44 +0000 (05:45 +1000)
gamemodes-server.cfg
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc

index cd71ecec0ee51d59ce45d0084598e74dbd826d44..28b434dc2436fd9ef265c42c85532592914bff9f 100644 (file)
@@ -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_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
 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
index aa05ea337b9bc2077315d6c94afe1b26f1dbe673..11bbaea6fb0af43f62e8c014e98718327f0af364 100644 (file)
@@ -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;
 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;
 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;
        }
 
                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);
 
        // captureshield setup
        ctf_CaptureShield_Spawn(this);