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 14cdb4f..a2776b6 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 258ad9e..c324732 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 01a6e83..c2346a4 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
+}