]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/radar.qc
Rename a lib function (overlaps with an old map entity field)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / radar.qc
index c357c6b999bc895ca0b56ee11bc654b20169fc80..3bc537c8f8b5e42760e5ca614ac4e02dadc4ce08 100644 (file)
@@ -1,6 +1,5 @@
 #include "radar.qh"
 
-#include "scoreboard.qh"
 #include <common/ent_cs.qh>
 #include <common/mapinfo.qh>
 #include <client/mapvoting.qh>
@@ -138,17 +137,11 @@ void HUD_Radar_Mouse()
                return;
        }
 
-       if(!autocvar_hud_cursormode)
-       {
-               mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed;
+       if (!autocvar_hud_cursormode)
+               update_mousepos();
 
-               mousepos_x = bound(0, mousepos_x, vid_conwidth);
-               mousepos_y = bound(0, mousepos_y, vid_conheight);
-       }
-
-       if(1 - scoreboard_fade_alpha <= 0)
-               return;
-       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
+       panel = HUD_PANEL(RADAR);
+       HUD_Panel_LoadCvars();
 
 
        panel_size = autocvar_hud_panel_radar_maximized_size;
@@ -200,9 +193,7 @@ void HUD_Radar()
        if ( hud_panel_radar_temp_hidden )
                return;
 
-       if(1 - scoreboard_fade_alpha <= 0)
-               return;
-       HUD_Panel_UpdateCvars(1 - scoreboard_fade_alpha);
+       HUD_Panel_LoadCvars();
 
        float f = 0;
 
@@ -321,10 +312,10 @@ void HUD_Radar()
        else
        {
                vector c0, c1, c2, c3, span;
-               c0 = rotate(mi_min, teamradar_angle * DEG2RAD);
-               c1 = rotate(mi_max, teamradar_angle * DEG2RAD);
-               c2 = rotate('1 0 0' * mi_min.x + '0 1 0' * mi_max.y, teamradar_angle * DEG2RAD);
-               c3 = rotate('1 0 0' * mi_max.x + '0 1 0' * mi_min.y, teamradar_angle * DEG2RAD);
+               c0 = Rotate(mi_min, teamradar_angle * DEG2RAD);
+               c1 = Rotate(mi_max, teamradar_angle * DEG2RAD);
+               c2 = Rotate('1 0 0' * mi_min.x + '0 1 0' * mi_max.y, teamradar_angle * DEG2RAD);
+               c3 = Rotate('1 0 0' * mi_max.x + '0 1 0' * mi_min.y, teamradar_angle * DEG2RAD);
                span = '0 0 0';
                span.x = max(c0_x, c1_x, c2_x, c3_x) - min(c0_x, c1_x, c2_x, c3_x);
                span.y = max(c0_y, c1_y, c2_y, c3_y) - min(c0_y, c1_y, c2_y, c3_y);
@@ -361,7 +352,7 @@ void HUD_Radar()
        IL_EACH(g_radaricons, it.teamradar_icon, {
                if ( hud_panel_radar_mouse )
                if ( it.health >= 0 )
-               if ( it.team == myteam+1 || gametype == MAPINFO_TYPE_RACE || !(serverflags & SERVERFLAG_TEAMPLAY) )
+               if ( it.team == myteam + 1 || gametype == MAPINFO_TYPE_RACE || !teamplay )
                {
                        vector coord = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(it.origin));
                        if(vdist((mousepos - coord), <, 8))