]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a mutator hook to allow forcing team radar icons to display regardless of their...
authorMario <mario.mario@y7mail.com>
Mon, 13 Jul 2020 10:20:51 +0000 (20:20 +1000)
committerMario <mario.mario@y7mail.com>
Mon, 13 Jul 2020 10:20:51 +0000 (20:20 +1000)
qcsrc/client/hud/panel/radar.qc
qcsrc/client/mutators/events.qh
qcsrc/common/gamemodes/gamemode/race/cl_race.qc

index 14cdb4f68a4f0ece6848a4013c1114cdfa6f2c97..a2776b662d2c4ce3e2b79c653bdb306e51d5b342 100644 (file)
@@ -353,10 +353,12 @@ void HUD_Radar()
 
        IL_EACH(g_radarlinks, true, draw_teamradar_link(it.origin, it.velocity, it.team));
 
+       bool mutator_returnvalue = MUTATOR_CALLHOOK(TeamRadar_Draw); // TODO: allow players to show on the radar as well!
+
        IL_EACH(g_radaricons, it.teamradar_icon, {
                if ( hud_panel_radar_mouse )
                if ( GetResource(it, RES_HEALTH) >= 0 )
-               if ( it.team == myteam + 1 || ISGAMETYPE(RACE) || !teamplay )
+               if ( it.team == myteam + 1 || mutator_returnvalue || !teamplay )
                {
                        vector coord = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(it.origin));
                        if(vdist((mousepos - coord), <, 8))
index 258ad9e1197342bcefd5f426a12d53c717e5ab1a..c324732b2a976426ff932d20ad7c1600c615df6e 100644 (file)
@@ -228,3 +228,6 @@ MUTATOR_HOOKABLE(ShowNames_Draw, EV_ShowNames_Draw);
 
 /** Return true to display the race timer HUD panel */
 MUTATOR_HOOKABLE(ShowRaceTimer, EV_NO_ARGS);
+
+/** Return true to force team radar to display entities regardless of their team */
+MUTATOR_HOOKABLE(TeamRadar_Draw, EV_NO_ARGS);
index 01a6e83b21b691e40ed4548cecbf7f25ed30dcd1..c2346a4f2c84af163e5e38a5f241d5b54e2843db 100644 (file)
@@ -176,3 +176,8 @@ MUTATOR_HOOKFUNCTION(cl_race, ShowRaceTimer)
 {
        return ISGAMETYPE(RACE); // show the race timer panel
 }
+
+MUTATOR_HOOKFUNCTION(cl_race, TeamRadar_Draw)
+{
+       return ISGAMETYPE(RACE); // show all competitors in a race
+}